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.62 by spiga, Fri Jun 12 09:38:54 2009 UTC vs.
Revision 1.66.2.2 by farinafa, Tue Feb 23 16:53:16 2010 UTC

# Line 325 | Line 325 | class DBinterface:
325      def deserXmlStatus(self, reportList):
326  
327          task = self.getTask()
328 +        if int(self.cfg_params.get('WMBS.automation',0)) == 1:
329 +            if len(reportList) ==0:
330 +                msg = 'You are using CRAB with WMBS the server is still creating your jobs.\n'
331 +                msg += '\tPlease wait...'
332 +                raise CrabException(msg)
333 +            newJobs =  len(reportList) - len(task.jobs)
334 +            if newJobs != 0:
335 +                isNew=True  
336 +                if len(task.jobs):isNew=False
337 +                jobL=[]  
338 +                for i in range(1,newJobs+1):
339 +                    jobL.append(len(task.jobs)+i)
340 +                self.createJobs_(jobL,isNew)
341 +
342          for job in task.jobs:
343              if not job.runningJob:
344                  raise CrabException( "Missing running object for job %s"%str(job['jobId']) )
# Line 354 | Line 368 | class DBinterface:
368                      break
369                    
370              # Data alignment
371 <            if rForJ.getAttribute('status') not in ['Created', 'Unknown']:
371 >            if rForJ.getAttribute('status') not in ['Unknown']: # ['Created', 'Unknown']:
372                     # update the status  
373                  common.logger.debug("Updating DB status for job: " + str(id) + " @: " \
374                                        + str(rForJ.getAttribute('status')) )
# Line 380 | Line 394 | class DBinterface:
394  
395                  job.runningJob['state'] = str( rForJ.getAttribute('action') )
396            
397 <            #if str( rForJ.getAttribute('resubmit') ).isdigit():
398 <            #    job['submissionNumber'] = int(rForJ.getAttribute('resubmit'))
399 <            #    job.runningJob['submission'] =  int(rForJ.getAttribute('resubmit'))
397 >                # Needed for unique naming of the output.
398 >                # GIVES PROBLEMS. FIX in >=2_7_2    
399 >                #job.runningJob['submission'] =  int(rForJ.getAttribute('submission'))
400            
387            # TODO cleared='0' field, how should it be handled/mapped in BL? #Fabio
388
401          common.bossSession.updateDB( task_new )
402          return
403  
# Line 396 | Line 408 | class DBinterface:
408                  return False
409          return True
410  
411 +    # Method to update arguments w.r.t. resubmission number in order to grant unique output
412 +    def updateResubAttribs(self, jobsL):
413 +        task = self.getTask(jobsL)
414 +        for j in task.jobs:
415 +            common.bossSession.getRunningInstance(j)
416 +            newArgs = "%d %d"%(j.runningJob['jobId'], j.runningJob['submission'])
417 +            j['arguments'] = newArgs
418 +            
419 +        common.bossSession.updateDB(task)
420 +        return
421 +
422  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines