24 |
|
glite_config = gliteConfig.config() |
25 |
|
|
26 |
|
if (glite_config ): |
27 |
< |
rb_param_file = 'WMSconfig = '+glite_config+';\n' |
27 |
> |
rb_param_file = glite_config |
28 |
|
return rb_param_file |
29 |
|
|
30 |
|
def ce_list(self): |
64 |
|
|
65 |
|
return req |
66 |
|
|
67 |
< |
def se_list(self, id): |
67 |
> |
def se_list(self, id, dest): |
68 |
|
""" |
69 |
|
Returns string with requirement SE related |
70 |
|
""" |
71 |
< |
hostList=self.findSites_(id) |
71 |
> |
hostList=self.findSites_(id,dest) |
72 |
|
req='' |
73 |
|
reqtmp=[] |
74 |
|
concString = '||' |
107 |
|
|
108 |
|
return req |
109 |
|
|
110 |
< |
def sched_parameter(self): |
110 |
> |
def sched_fix_parameter(self): |
111 |
|
""" |
112 |
|
Returns string with requirements and scheduler-specific parameters |
113 |
|
""" |
114 |
< |
index = int(common._db.nJobs()) - 1 |
115 |
< |
job = common.job_list[index] |
114 |
> |
index = int(common._db.nJobs()) |
115 |
> |
job = common.job_list[index-1] |
116 |
|
jbt = job.type() |
117 |
– |
|
118 |
– |
### To Be Removed BL--DS |
119 |
– |
# lastDest='' |
120 |
– |
# first = [] |
121 |
– |
# last = [] |
122 |
– |
# for n in range(common.jobDB.nJobs()): |
123 |
– |
# currDest=common.jobDB.destination(n) |
124 |
– |
# if (currDest!=lastDest): |
125 |
– |
# lastDest = currDest |
126 |
– |
# first.append(n) |
127 |
– |
# if n != 0:last.append(n-1) |
128 |
– |
# if len(first)>len(last) :last.append(common.jobDB.nJobs()) |
129 |
– |
|
117 |
|
req = '' |
118 |
|
req = req + jbt.getRequirements() |
119 |
|
|
120 |
|
if self.EDG_requirements: |
121 |
|
if (not req == ' '): req = req + ' && ' |
122 |
|
req = req + self.EDG_requirements |
136 |
– |
sched_param='' |
137 |
– |
sched_param='""pippo""' |
123 |
|
|
124 |
< |
### Temporary Problem with quote and py2sqlite.... under investigation.. |
125 |
< |
for i in range(index): |
126 |
< |
# sched_param+='Requirements = ' + req +self.specific_req() + self.se_list(i) +\ |
127 |
< |
# self.ce_list() +';\n' ## BL--DS |
128 |
< |
# if self.EDG_addJdlParam: sched_param+=self.jdlParam() ## BL--DS |
129 |
< |
# if (self.rb_param_file): sched_param+=self.rb_param_file ## BL--DS |
130 |
< |
# print sched_param |
131 |
< |
run_jobReq={'schedulerAttributes':sched_param}## DS--BL |
132 |
< |
common._db.updateRunJob_(i,run_jobReq) |
124 |
> |
Task_Req={'jobType':req}## DS--BL |
125 |
> |
common._db.updateTask_(Task_Req) |
126 |
> |
|
127 |
> |
def sched_parameter(self,i,task): |
128 |
> |
""" |
129 |
> |
Returns string with requirements and scheduler-specific parameters |
130 |
> |
""" |
131 |
> |
dest= eval(task.jobs[i]['dlsDestination']) ## DS--BL |
132 |
> |
|
133 |
> |
req='' |
134 |
> |
req +=task['jobType'] |
135 |
> |
|
136 |
> |
sched_param='' |
137 |
> |
sched_param+='Requirements = ' + req +self.specific_req() + self.se_list(i,dest) +\ |
138 |
> |
self.ce_list() +';\n' ## BL--DS |
139 |
> |
if self.EDG_addJdlParam: sched_param+=self.jdlParam() ## BL--DS |
140 |
> |
sched_param+='MyProxyServer = "' + self.proxyServer + '";\n' |
141 |
> |
sched_param+='VirtualOrganisation = "' + self.VO + '";\n' |
142 |
> |
sched_param+='RetryCount = '+str(self.EDG_retry_count)+';\n' |
143 |
> |
sched_param+='ShallowRetryCount = '+str(self.EDG_shallow_retry_count)+';\n' |
144 |
|
|
145 |
+ |
return sched_param |
146 |
+ |
|
147 |
|
def wsSetupEnvironment(self): |
148 |
|
""" |
149 |
|
Returns part of a job script which does scheduler-specific work. |
244 |
|
cmd_out = runCommand(cmd) |
245 |
|
return cmd_out |
246 |
|
|
247 |
+ |
def findSites_(self, n, sites): |
248 |
+ |
itr4 =[] |
249 |
+ |
if len(sites)>0 and sites[0]=="": |
250 |
+ |
return itr4 |
251 |
+ |
if sites != [""]: |
252 |
+ |
##Addedd Daniele |
253 |
+ |
replicas = self.blackWhiteListParser.checkBlackList(sites,n) |
254 |
+ |
if len(replicas)!=0: |
255 |
+ |
replicas = self.blackWhiteListParser.checkWhiteList(replicas,n) |
256 |
+ |
|
257 |
+ |
itr4 = replicas |
258 |
+ |
##### |
259 |
+ |
return itr4 |
260 |
+ |
|
261 |
+ |
|
262 |
+ |
|
263 |
|
|
264 |
|
def tOut(self, list): |
265 |
|
return 180 |