19
19
from DIRAC import S_ERROR , S_OK , gConfig
20
20
from DIRAC .AccountingSystem .Client .DataStoreClient import gDataStoreClient
21
21
from DIRAC .AccountingSystem .Client .Types .Pilot import Pilot as PilotAccounting
22
- from DIRAC .AccountingSystem .Client .Types .PilotSubmission import PilotSubmission as PilotSubmissionAccounting
22
+ from DIRAC .AccountingSystem .Client .Types .PilotSubmission import (
23
+ PilotSubmission as PilotSubmissionAccounting ,
24
+ )
23
25
from DIRAC .ConfigurationSystem .Client .Helpers import CSGlobals , Registry
24
26
from DIRAC .ConfigurationSystem .Client .Helpers .Operations import Operations
25
27
from DIRAC .ConfigurationSystem .Client .Helpers .Resources import getCESiteMapping
29
31
from DIRAC .FrameworkSystem .Client .ProxyManagerClient import gProxyManager
30
32
from DIRAC .FrameworkSystem .Client .TokenManagerClient import gTokenManager
31
33
from DIRAC .MonitoringSystem .Client .MonitoringReporter import MonitoringReporter
34
+ from DIRAC .Resources .Computing .ComputingElement import ComputingElement
32
35
from DIRAC .ResourceStatusSystem .Client .ResourceStatus import ResourceStatus
33
36
from DIRAC .ResourceStatusSystem .Client .SiteStatus import SiteStatus
34
- from DIRAC .Resources .Computing .ComputingElement import ComputingElement
35
37
from DIRAC .WorkloadManagementSystem .Client import PilotStatus
36
- from DIRAC .WorkloadManagementSystem .Client .PilotScopes import PILOT_SCOPES
37
-
38
38
from DIRAC .WorkloadManagementSystem .Client .MatcherClient import MatcherClient
39
+ from DIRAC .WorkloadManagementSystem .Client .PilotScopes import PILOT_SCOPES
39
40
from DIRAC .WorkloadManagementSystem .Client .ServerUtils import getPilotAgentsDB
40
- from DIRAC .WorkloadManagementSystem .private .ConfigHelper import findGenericPilotCredentials
41
+ from DIRAC .WorkloadManagementSystem .private .ConfigHelper import (
42
+ findGenericPilotCredentials ,
43
+ )
41
44
from DIRAC .WorkloadManagementSystem .Service .WMSUtilities import getGridEnv
42
45
from DIRAC .WorkloadManagementSystem .Utilities .PilotWrapper import (
43
46
_writePilotWrapperFile ,
@@ -78,9 +81,6 @@ def __init__(self, *args, **kwargs):
78
81
79
82
self .gridEnv = ""
80
83
self .vo = ""
81
- self .group = ""
82
- # self.voGroups contain all the eligible user groups for pilots submitted by this SiteDirector
83
- self .voGroups = []
84
84
self .pilotDN = ""
85
85
self .pilotGroup = ""
86
86
self .platforms = []
@@ -126,27 +126,11 @@ def initialize(self):
126
126
self .gridEnv = getGridEnv ()
127
127
128
128
# The SiteDirector is for a particular user community
129
- self .vo = self .am_getOption ("VO" , "" )
130
- if not self .vo :
131
- self .vo = self .am_getOption ("Community" , "" )
129
+ self .vo = self .am_getOption ("VO" , self .am_getOption ("Community" , "" ))
132
130
if not self .vo :
133
131
self .vo = CSGlobals .getVO ()
134
- # The SiteDirector is for a particular user group
135
- self .group = self .am_getOption ("Group" , "" )
136
-
137
- # Choose the group for which pilots will be submitted. This is a hack until
138
- # we will be able to match pilots to VOs.
139
- if not self .group :
140
- if self .vo :
141
- result = Registry .getGroupsForVO (self .vo )
142
- if not result ["OK" ]:
143
- return result
144
- self .voGroups = []
145
- for group in result ["Value" ]:
146
- if "NormalUser" in Registry .getPropertiesForGroup (group ):
147
- self .voGroups .append (group )
148
- else :
149
- self .voGroups = [self .group ]
132
+ if not self .vo :
133
+ return S_ERROR ("Need a VO" )
150
134
151
135
# Get the clients
152
136
self .siteClient = SiteStatus ()
@@ -225,8 +209,6 @@ def beginExecution(self):
225
209
tags = None
226
210
227
211
self .log .always ("VO:" , self .vo )
228
- if self .voGroups :
229
- self .log .always ("Group(s):" , self .voGroups )
230
212
self .log .always ("Sites:" , siteNames )
231
213
self .log .always ("CETypes:" , ceTypes )
232
214
self .log .always ("CEs:" , ces )
@@ -570,10 +552,7 @@ def _getTQDictForMatching(self):
570
552
:returns dict: tqDict of task queue descriptions
571
553
"""
572
554
tqDict = {"Setup" : CSGlobals .getSetup (), "CPUTime" : 9999999 }
573
- if self .vo :
574
- tqDict ["Community" ] = self .vo
575
- if self .voGroups :
576
- tqDict ["OwnerGroup" ] = self .voGroups
555
+ tqDict ["Community" ] = self .vo
577
556
578
557
if self .checkPlatform :
579
558
platforms = self ._getPlatforms ()
@@ -667,10 +646,7 @@ def _getCE(self, queue):
667
646
668
647
if self .queueDict [queue ]["Site" ] not in self .siteMaskList :
669
648
ceDict ["JobType" ] = "Test"
670
- if self .vo :
671
- ceDict ["Community" ] = self .vo
672
- if self .voGroups :
673
- ceDict ["OwnerGroup" ] = self .voGroups
649
+ ceDict ["Community" ] = self .vo
674
650
675
651
if self .checkPlatform :
676
652
platform = self .queueDict [queue ]["ParametersDict" ].get ("Platform" )
@@ -1049,8 +1025,7 @@ def _getPilotOptions(self, queue, **kwargs):
1049
1025
# SiteName
1050
1026
pilotOptions .append (f"-n { queueDict ['Site' ]} " )
1051
1027
# VO
1052
- if self .vo :
1053
- pilotOptions .append (f"--wnVO={ self .vo } " )
1028
+ pilotOptions .append (f"--wnVO={ self .vo } " )
1054
1029
1055
1030
# Generic Options
1056
1031
if "GenericOptions" in queueDict :
@@ -1070,9 +1045,6 @@ def _getPilotOptions(self, queue, **kwargs):
1070
1045
if "PipInstallOptions" in queueDict :
1071
1046
pilotOptions .append (f"--pipInstallOptions={ queueDict ['PipInstallOptions' ]} " )
1072
1047
1073
- if self .group :
1074
- pilotOptions .append (f"-G { self .group } " )
1075
-
1076
1048
return pilotOptions
1077
1049
1078
1050
####################################################################################
0 commit comments