ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/DBinterface.py
(Generate patch)

Comparing COMP/CRAB/python/DBinterface.py (file contents):
Revision 1.15 by mcinquil, Tue Apr 15 14:13:07 2008 UTC vs.
Revision 1.16 by spiga, Tue Apr 15 16:34:58 2008 UTC

# Line 305 | Line 305 | class DBinterface:
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines