Skip to content

Commit c7c070a

Browse files
committed
fix: correct import order in dirac_admin_voms_sync
1 parent 84082dc commit c7c070a

File tree

1 file changed

+26
-29
lines changed

1 file changed

+26
-29
lines changed

src/DIRAC/ConfigurationSystem/scripts/dirac_admin_voms_sync.py

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,49 @@
66
"""
77
Synchronize VOMS user data with the DIRAC Registry
88
"""
9-
from DIRAC import gLogger, exit as DIRACExit, S_OK
109
from DIRAC.Core.Base.Script import Script
11-
from DIRAC.ConfigurationSystem.Client.VOMS2CSSynchronizer import VOMS2CSSynchronizer
12-
from DIRAC.Core.Utilities.Proxy import executeWithUserProxy
13-
from DIRAC.ConfigurationSystem.Client.Helpers.Registry import getVOOption
14-
from DIRAC.FrameworkSystem.Client.TokenManagerClient import gTokenManager
10+
from DIRAC import gLogger, exit as DIRACExit, S_OK
1511

1612
dryRun = False
1713
voName = None
1814
compareWithIAM = False
1915
useIAM = False
2016

2117

22-
def setDryRun(value):
23-
global dryRun
24-
dryRun = True
25-
return S_OK()
26-
27-
28-
def setVO(value):
29-
global voName
30-
voName = value
31-
return S_OK()
32-
33-
34-
def setCompareWithIAM(value):
35-
global compareWithIAM
36-
compareWithIAM = True
37-
return S_OK()
38-
39-
40-
def setUseIAM(value):
41-
global useIAM
42-
useIAM = True
43-
return S_OK()
44-
45-
4618
@Script()
4719
def main():
20+
def setDryRun(value):
21+
global dryRun
22+
dryRun = True
23+
return S_OK()
24+
25+
def setVO(value):
26+
global voName
27+
voName = value
28+
return S_OK()
29+
30+
def setCompareWithIAM(value):
31+
global compareWithIAM
32+
compareWithIAM = True
33+
return S_OK()
34+
35+
def setUseIAM(value):
36+
global useIAM
37+
useIAM = True
38+
return S_OK()
39+
4840
Script.registerSwitch("V:", "vo=", "VO name", setVO)
4941
Script.registerSwitch("D", "dryRun", "Dry run", setDryRun)
5042
Script.registerSwitch("C", "compareWithIAM", "Compare user list with IAM", setCompareWithIAM)
5143
Script.registerSwitch("I", "useIAM", "Use IAM as authoritative source", setUseIAM)
5244

5345
Script.parseCommandLine(ignoreErrors=True)
5446

47+
from DIRAC.ConfigurationSystem.Client.VOMS2CSSynchronizer import VOMS2CSSynchronizer
48+
from DIRAC.Core.Utilities.Proxy import executeWithUserProxy
49+
from DIRAC.ConfigurationSystem.Client.Helpers.Registry import getVOOption
50+
from DIRAC.FrameworkSystem.Client.TokenManagerClient import gTokenManager
51+
5552
@executeWithUserProxy
5653
def syncCSWithVOMS(vomsSync):
5754
return vomsSync.syncCSWithVOMS()

0 commit comments

Comments
 (0)