@@ -94,14 +94,13 @@ def __init__(self, ceUniqueID):
94
94
95
95
# set the timeout to the default 20 seconds in case the UserConfig constructor did not
96
96
self .usercfg .Timeout (20 ) # pylint: disable=pointless-statement
97
- self .ceHost = self .ceParameters .get ("Host" , self .ceName )
98
- self .gridEnv = self .ceParameters .get ("GridEnv" , self .gridEnv )
97
+ self .gridEnv = ""
99
98
100
99
# Used in getJobStatus
101
100
self .mapStates = STATES_MAP
102
- # Do these after all other initialisations, in case something barks
103
- self .xrslExtraString = self . __getXRSLExtraString ()
104
- self .xrslMPExtraString = self . __getXRSLExtraString ( multiprocessor = True )
101
+ # Extra XRSL info
102
+ self .xrslExtraString = ""
103
+ self .xrslMPExtraString = ""
105
104
106
105
#############################################################################
107
106
@@ -138,59 +137,6 @@ def _getARCJob(self, jobID):
138
137
j .PrepareHandler (self .usercfg )
139
138
return j
140
139
141
- def __getXRSLExtraString (self , multiprocessor = False ):
142
- # For the XRSL additional string from configuration - only done at initialisation time
143
- # If this string changes, the corresponding (ARC) site directors have to be restarted
144
- #
145
- # Variable = XRSLExtraString (or XRSLMPExtraString for multi processor mode)
146
- # Default value = ''
147
- # If you give a value, I think it should be of the form
148
- # (aaa = "xxx")
149
- # Otherwise the ARC job description parser will have a fit
150
- # Locations searched in order :
151
- # Top priority : Resources/Sites/<Grid>/<Site>/CEs/<CE>/XRSLExtraString
152
- # Second priority : Resources/Sites/<Grid>/<Site>/XRSLExtraString
153
- # Default : Resources/Computing/CEDefaults/XRSLExtraString
154
- #
155
- xrslExtraString = "" # Start with the default value
156
- result = getCESiteMapping (self .ceHost )
157
- if not result ["OK" ] or not result ["Value" ]:
158
- self .log .error ("Unknown CE ..." )
159
- return
160
- self .site = result ["Value" ][self .ceHost ]
161
- # Now we know the site. Get the grid
162
- grid = self .site .split ("." )[0 ]
163
- # The different possibilities that we have agreed upon
164
- if multiprocessor :
165
- xtraVariable = "XRSLMPExtraString"
166
- else :
167
- xtraVariable = "XRSLExtraString"
168
- firstOption = f"Resources/Sites/{ grid } /{ self .site } /CEs/{ self .ceHost } /{ xtraVariable } "
169
- secondOption = f"Resources/Sites/{ grid } /{ self .site } /{ xtraVariable } "
170
- defaultOption = "Resources/Computing/CEDefaults/%s" % xtraVariable
171
- # Now go about getting the string in the agreed order
172
- self .log .debug (f"Trying to get { xtraVariable } : first option { firstOption } " )
173
- result = gConfig .getValue (firstOption , defaultValue = "" )
174
- if result != "" :
175
- xrslExtraString = result
176
- self .log .debug (f"Found { xtraVariable } : { xrslExtraString } " )
177
- else :
178
- self .log .debug (f"Trying to get { xtraVariable } : second option { secondOption } " )
179
- result = gConfig .getValue (secondOption , defaultValue = "" )
180
- if result != "" :
181
- xrslExtraString = result
182
- self .log .debug (f"Found { xtraVariable } : { xrslExtraString } " )
183
- else :
184
- self .log .debug (f"Trying to get { xtraVariable } : default option { defaultOption } " )
185
- result = gConfig .getValue (defaultOption , defaultValue = "" )
186
- if result != "" :
187
- xrslExtraString = result
188
- self .log .debug (f"Found { xtraVariable } : { xrslExtraString } " )
189
- if xrslExtraString :
190
- self .log .always (f"{ xtraVariable } : { xrslExtraString } " )
191
- self .log .always (" --- to be added to pilots going to CE : %s" % self .ceHost )
192
- return xrslExtraString
193
-
194
140
#############################################################################
195
141
def _addCEConfigDefaults (self ):
196
142
"""Method to make sure all necessary Configuration Parameters are defined"""
@@ -283,8 +229,12 @@ def _bundlePreamble(self, executableFile):
283
229
#############################################################################
284
230
def _reset (self ):
285
231
self .queue = self .ceParameters .get ("CEQueueName" , self .ceParameters ["Queue" ])
286
- if "GridEnv" in self .ceParameters :
287
- self .gridEnv = self .ceParameters ["GridEnv" ]
232
+ self .ceHost = self .ceParameters .get ("Host" , self .ceHost )
233
+ self .gridEnv = self .ceParameters .get ("GridEnv" , self .gridEnv )
234
+
235
+ # extra XRSL data (should respect the XRSL format)
236
+ self .xrslExtraString = self .ceParameters .get ("XRSLExtraString" , self .xrslExtraString )
237
+ self .xrslMPExtraString = self .ceParameters .get ("XRSLMPExtraString" , self .xrslMPExtraString )
288
238
289
239
self .preamble = self .ceParameters .get ("Preamble" , self .preamble )
290
240
0 commit comments