315 |
|
def deserXmlStatus(self, reportList): |
316 |
|
|
317 |
|
task = self.getTask() |
318 |
– |
|
318 |
|
for job in task.jobs: |
319 |
|
if not job.runningJob: |
320 |
|
raise CrabException( "Missing running object for job %s"%str(job['jobId']) ) |
321 |
|
|
322 |
|
id = str(job.runningJob['jobId']) |
324 |
– |
# TODO linear search, probably it can be optized with binary search |
323 |
|
rForJ = None |
324 |
+ |
nj_list= [] |
325 |
|
for r in reportList: |
326 |
|
if r.getAttribute('id') in [ id, 'all']: |
327 |
|
rForJ = r |
328 |
|
break |
329 |
+ |
## Check the submission number and create new running jobs on the client side |
330 |
+ |
if int(job.runningJob['submission']) < int(rForJ.getAttribute('resubmit')) + 1: |
331 |
+ |
nj_list.append(id) |
332 |
+ |
self.newRunJobs(nj_list) |
333 |
+ |
|
334 |
+ |
task_new = self.getTask() |
335 |
|
|
336 |
+ |
for job in task_new.jobs: |
337 |
+ |
id = str(job.runningJob['jobId']) |
338 |
+ |
# TODO linear search, probably it can be optized with binary search |
339 |
+ |
rForJ = None |
340 |
+ |
for r in reportList: |
341 |
+ |
if r.getAttribute('id') in [ id, 'all']: |
342 |
+ |
rForJ = r |
343 |
+ |
break |
344 |
|
# Data alignment |
345 |
|
jobStatus = str(job.runningJob['statusScheduler']) |
346 |
|
if rForJ.getAttribute('statusScheduler') not in ['Created', 'Submitting', 'Unknown'] and \ |
364 |
|
|
365 |
|
# TODO cleared='0' field, how should it be handled/mapped in BL? #Fabio |
366 |
|
|
367 |
< |
common.bossSession.updateDB( task ) |
367 |
> |
common.bossSession.updateDB( task_new ) |
368 |
|
return |
369 |
|
|
370 |
|
# FIXME temporary method to verify what kind of submission to perform towards the server |