305 |
|
for i in task: |
306 |
|
matched.append(i[field]) |
307 |
|
return matched |
308 |
+ |
|
309 |
+ |
def deserXmlStatus(self, reportList): |
310 |
+ |
|
311 |
+ |
task = self.getTask() |
312 |
+ |
|
313 |
+ |
for job in task.jobs: |
314 |
+ |
if not job.runningJob: |
315 |
+ |
raise CrabException( "Missing running object for job %s"%str(job['id']) ) |
316 |
+ |
|
317 |
+ |
id = str(job.runningJob['id']) |
318 |
+ |
# TODO linear search, probably it can be optized with binary search |
319 |
+ |
rForJ = None |
320 |
+ |
for r in reportList: |
321 |
+ |
if r.getAttribute('id') in [ id, 'all']: |
322 |
+ |
rForJ = r |
323 |
+ |
break |
324 |
+ |
|
325 |
+ |
# Data alignment |
326 |
+ |
jobStatus = str(job.runningJob['statusScheduler']) |
327 |
+ |
if rForJ.getAttribute('status') not in ['Created', 'Submitting']: |
328 |
+ |
job.runningJob['statusScheduler'] = str( rForJ.getAttribute('status') ) |
329 |
+ |
jobStatus = str(job.runningJob['statusScheduler']) |
330 |
+ |
job.runningJob['status'] = str( rForJ.getAttribute('sched_status') ) |
331 |
+ |
|
332 |
+ |
job.runningJob['destination'] = str( rForJ.getAttribute('site') ) |
333 |
+ |
dest = str(job.runningJob['destination']).split(':')[0] |
334 |
+ |
|
335 |
+ |
job.runningJob['applicationReturnCode'] = str( rForJ.getAttribute('exe_exit') ) |
336 |
+ |
exe_exit_code = str(job.runningJob['applicationReturnCode']) |
337 |
+ |
|
338 |
+ |
job.runningJob['wrapperReturnCode'] = str( rForJ.getAttribute('job_exit') ) |
339 |
+ |
job_exit_code = str(job.runningJob['wrapperReturnCode']) |
340 |
+ |
|
341 |
+ |
if str( rForJ.getAttribute('resubmit') ).isdigit(): |
342 |
+ |
job['submissionNumber'] = int(rForJ.getAttribute('resubmit')) |
343 |
+ |
# TODO cleared='0' field, how should it be handled/mapped in BL? #Fabio |
344 |
+ |
|
345 |
+ |
common.bossSession.updateDB( task ) |
346 |
+ |
|
347 |
+ |
return |