23 |
|
def configure(self, cfg_params): |
24 |
|
|
25 |
|
try: |
26 |
< |
RB = cfg_params["EDG.rb"] |
27 |
< |
edgConfig = EdgConfig(RB) |
28 |
< |
self.edg_config = edgConfig.config() |
29 |
< |
self.edg_config_vo = edgConfig.configVO() |
26 |
> |
RB=cfg_params["EDG.rb"] |
27 |
> |
self.rb_param_file=self.rb_configure(RB) |
28 |
|
except KeyError: |
29 |
< |
self.edg_config = '' |
30 |
< |
self.edg_config_vo = '' |
33 |
< |
|
29 |
> |
self.rb_param_file='' |
30 |
> |
pass |
31 |
|
try: |
32 |
|
self.proxyServer = cfg_params["EDG.proxy_server"] |
33 |
|
except KeyError: |
49 |
|
|
50 |
|
try: |
51 |
|
self.EDG_ce_black_list = cfg_params['EDG.ce_black_list'] |
55 |
– |
#print "self.EDG_ce_black_list = ", self.EDG_ce_black_list |
52 |
|
except KeyError: |
53 |
|
self.EDG_ce_black_list = '' |
54 |
|
|
55 |
|
try: |
56 |
|
self.EDG_ce_white_list = cfg_params['EDG.ce_white_list'] |
61 |
– |
#print "self.EDG_ce_white_list = ", self.EDG_ce_white_list |
57 |
|
except KeyError: self.EDG_ce_white_list = '' |
58 |
|
|
59 |
|
try: self.VO = cfg_params['EDG.virtual_organization'] |
123 |
|
try: self.EDG_requirements = cfg_params['EDG.requirements'] |
124 |
|
except KeyError: self.EDG_requirements = '' |
125 |
|
|
126 |
+ |
try: self.EDG_addJdlParam = string.split(cfg_params['EDG.additional_jdl_parameters'],',') |
127 |
+ |
except KeyError: self.EDG_addJdlParam = [] |
128 |
+ |
|
129 |
|
try: self.EDG_retry_count = cfg_params['EDG.retry_count'] |
130 |
|
except KeyError: self.EDG_retry_count = '' |
131 |
|
|
167 |
|
return |
168 |
|
|
169 |
|
|
170 |
+ |
def rb_configure(self, RB): |
171 |
+ |
self.edg_config = '' |
172 |
+ |
self.edg_config_vo = '' |
173 |
+ |
self.rb_param_file = '' |
174 |
+ |
|
175 |
+ |
edgConfig = EdgConfig(RB) |
176 |
+ |
self.edg_config = edgConfig.config() |
177 |
+ |
self.edg_config_vo = edgConfig.configVO() |
178 |
+ |
|
179 |
+ |
if (self.edg_config and self.edg_config_vo != ''): |
180 |
+ |
self.rb_param_file = 'RBconfig = "'+self.edg_config+'";\nRBconfigVO = "'+self.edg_config_vo+'";' |
181 |
+ |
#print "rb_param_file = ", self.rb_param_file |
182 |
+ |
return self.rb_param_file |
183 |
+ |
|
184 |
+ |
|
185 |
|
def sched_parameter(self): |
186 |
|
""" |
187 |
|
Returns file with requirements and scheduler-specific parameters |
249 |
|
req = req + ' && anyMatch(other.storage.CloseSEs, ('+str(arg)+'))' |
250 |
|
param_file.write('Requirements = '+req +';\n') |
251 |
|
|
252 |
< |
if (self.edg_config and self.edg_config_vo != ''): |
253 |
< |
param_file.write('RBconfig = "'+self.edg_config+'";\n') |
254 |
< |
param_file.write('RBconfigVO = "'+self.edg_config_vo+'";') |
252 |
> |
if (self.rb_param_file != ''): |
253 |
> |
param_file.write(self.rb_param_file) |
254 |
> |
|
255 |
> |
if len(self.EDG_addJdlParam): |
256 |
> |
for p in self.EDG_addJdlParam: |
257 |
> |
param_file.write(p) |
258 |
|
|
259 |
|
param_file.close() |
260 |
|
|
677 |
|
req=' ' |
678 |
|
req = req + jbt.getRequirements() |
679 |
|
|
664 |
– |
|
665 |
– |
#sites = common.jobDB.destination(nj) |
666 |
– |
#if len(sites)>0 and sites[0]!="Any": |
667 |
– |
# req = req + ' && anyMatch(other.storage.CloseSEs, (_ITR4_))' |
668 |
– |
#req = req |
669 |
– |
|
680 |
|
if self.EDG_requirements: |
681 |
|
if (req == ' '): |
682 |
|
req = req + self.EDG_requirements |
773 |
|
xml.write('<exec> ' + os.path.basename(script) +' </exec>\n') |
774 |
|
xml.write(jt_string) |
775 |
|
|
766 |
– |
|
767 |
– |
### only one .sh JDL has arguments: |
768 |
– |
### Fabio |
769 |
– |
# xml.write('args = "' + str(nj+1)+' '+ jbt.getJobTypeArguments(nj, "EDG") +'"\n') |
776 |
|
xml.write('<args> <![CDATA[\n _ITR2_ \n]]> </args>\n') |
777 |
|
xml.write('<program_types> crabjob </program_types>\n') |
778 |
|
inp_box = script + ',' |