180 |
|
Jobs = task.getJobs() |
181 |
|
print "--------------------------" |
182 |
|
for Job in Jobs: |
183 |
< |
print "Id: ",Job['id'] |
183 |
> |
print "Id: ",Job['jobId'] |
184 |
|
print "Dest: ", Job['dlsDestination'] |
185 |
|
print "Output: ", Job['outputFiles'] |
186 |
|
print "Args: ",Job['arguments'] |
206 |
|
for job in task.jobs: |
207 |
|
toPrint='' |
208 |
|
common.bossSession.getRunningInstance(job) |
209 |
< |
toPrint = "%-5s %-50s " % (job['id'],job.runningJob['schedulerId']) |
209 |
> |
toPrint = "%-5s %-50s " % (job['jobId'],job.runningJob['schedulerId']) |
210 |
|
lines.append(toPrint) |
211 |
|
header+= "%-5s %-50s " % ('Job:','ID' ) |
212 |
|
displayReport(self,header,lines) |
299 |
|
matched.append(i.runningJob[field]) |
300 |
|
return matched |
301 |
|
|
302 |
+ |
def newRunJobs(self,nj='all'): |
303 |
+ |
""" |
304 |
+ |
Get new running instances |
305 |
+ |
""" |
306 |
+ |
task = self.getTask(nj) |
307 |
+ |
|
308 |
+ |
for job in task.jobs: |
309 |
+ |
common.bossSession.getNewRunningInstance(job) |
310 |
+ |
job.runningJob['status'] = 'C' |
311 |
+ |
job.runningJob['statusScheduler'] = 'Created' |
312 |
+ |
common.bossSession.updateDB(task) |
313 |
+ |
return |
314 |
+ |
|
315 |
|
def deserXmlStatus(self, reportList): |
316 |
|
|
317 |
|
task = self.getTask() |
318 |
|
|
319 |
|
for job in task.jobs: |
320 |
|
if not job.runningJob: |
321 |
< |
raise CrabException( "Missing running object for job %s"%str(job['id']) ) |
321 |
> |
raise CrabException( "Missing running object for job %s"%str(job['jobId']) ) |
322 |
|
|
323 |
< |
id = str(job.runningJob['id']) |
323 |
> |
id = str(job.runningJob['jobId']) |
324 |
|
# TODO linear search, probably it can be optized with binary search |
325 |
|
rForJ = None |
326 |
|
for r in reportList: |
330 |
|
|
331 |
|
# Data alignment |
332 |
|
jobStatus = str(job.runningJob['statusScheduler']) |
333 |
< |
if rForJ.getAttribute('status') not in ['Created', 'Submitting'] and \ |
333 |
> |
if rForJ.getAttribute('status') not in ['Created', 'Submitting', 'Unknown'] and \ |
334 |
|
job.runningJob['statusScheduler'] != 'Cleared': |
335 |
|
job.runningJob['statusScheduler'] = str( rForJ.getAttribute('status') ) |
336 |
|
jobStatus = str(job.runningJob['statusScheduler']) |
345 |
|
job.runningJob['wrapperReturnCode'] = str( rForJ.getAttribute('job_exit') ) |
346 |
|
job_exit_code = str(job.runningJob['wrapperReturnCode']) |
347 |
|
|
348 |
< |
if str( rForJ.getAttribute('resubmit') ).isdigit(): |
349 |
< |
job['submissionNumber'] = int(rForJ.getAttribute('resubmit')) |
348 |
> |
#if str( rForJ.getAttribute('resubmit') ).isdigit(): |
349 |
> |
# job['submissionNumber'] = int(rForJ.getAttribute('resubmit')) |
350 |
> |
# job.runningJob['submission'] = int(rForJ.getAttribute('resubmit')) |
351 |
> |
|
352 |
|
# TODO cleared='0' field, how should it be handled/mapped in BL? #Fabio |
353 |
|
|
354 |
|
common.bossSession.updateDB( task ) |