|
6 | 6 | """ |
7 | 7 | Synchronize VOMS user data with the DIRAC Registry |
8 | 8 | """ |
9 | | -from DIRAC import gLogger, exit as DIRACExit, S_OK |
10 | 9 | 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 |
15 | 11 |
|
16 | 12 | dryRun = False |
17 | 13 | voName = None |
18 | 14 | compareWithIAM = False |
19 | 15 | useIAM = False |
20 | 16 |
|
21 | 17 |
|
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 | | - |
46 | 18 | @Script() |
47 | 19 | 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 | + |
48 | 40 | Script.registerSwitch("V:", "vo=", "VO name", setVO) |
49 | 41 | Script.registerSwitch("D", "dryRun", "Dry run", setDryRun) |
50 | 42 | Script.registerSwitch("C", "compareWithIAM", "Compare user list with IAM", setCompareWithIAM) |
51 | 43 | Script.registerSwitch("I", "useIAM", "Use IAM as authoritative source", setUseIAM) |
52 | 44 |
|
53 | 45 | Script.parseCommandLine(ignoreErrors=True) |
54 | 46 |
|
| 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 | + |
55 | 52 | @executeWithUserProxy |
56 | 53 | def syncCSWithVOMS(vomsSync): |
57 | 54 | return vomsSync.syncCSWithVOMS() |
|
0 commit comments