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.66.2.2 by farinafa, Tue Feb 23 16:53:16 2010 UTC vs.
Revision 1.73 by belforte, Tue Mar 12 16:30:08 2013 UTC

# Line 81 | Line 81 | class DBinterface:
81          opt={}
82          if optsToSave.get('server_mode',0) == 1: opt['serverName']=optsToSave['server_name']
83          opt['name']= getUserName()+ '_' + string.split(common.work_space.topDir(),'/')[-2]+'_'+common.work_space.task_uuid()
84 <        task = Task( opt )
84 >        task = Task( opt )
85          try:
86              common.bossSession.saveTask( task )
87          except Exception, e :
# Line 350 | Line 350 | class DBinterface:
350                  if r.getAttribute('id') in [ id, 'all']:
351                      rForJ = r
352                      break
353 +
354 +            # check if rForJ is None
355 +            if rForJ is None:
356 +                common.logger.debug( "Missing XML element for job %s, skip update status"%str(id) )
357 +                continue
358 +            
359              ## Check the submission number and create new running jobs on the client side
360              if rForJ.getAttribute('resubmit') != 'None' and (rForJ.getAttribute('status') not in ['Cleared','Killed','Done','Done (Failed)','Not Submitted', 'Cancelled by user']) :
361                  if int(job.runningJob['submission']) < int(rForJ.getAttribute('resubmit')) + 1:
# Line 395 | Line 401 | class DBinterface:
401                  job.runningJob['state'] = str( rForJ.getAttribute('action') )
402            
403                  # Needed for unique naming of the output.
404 <                # GIVES PROBLEMS. FIX in >=2_7_2    
399 <                #job.runningJob['submission'] =  int(rForJ.getAttribute('submission'))
404 >                job['arguments'] = "%d %s"%(job.runningJob['jobId'], str(rForJ.getAttribute('submission')).strip() )
405            
406          common.bossSession.updateDB( task_new )
407          return
# Line 408 | Line 413 | class DBinterface:
413                  return False
414          return True
415  
416 <    # Method to update arguments w.r.t. resubmission number in order to grant unique output
416 >    # Method to update arguments w.r.t. resubmission number in order to grant unique output
417      def updateResubAttribs(self, jobsL):
418          task = self.getTask(jobsL)
419          for j in task.jobs:
420              common.bossSession.getRunningInstance(j)
421 <            newArgs = "%d %d"%(j.runningJob['jobId'], j.runningJob['submission'])
421 >            try:
422 >                resubNum = int(str(j['arguments']).split(' ')[1]) + 1
423 >            except Exception, e:
424 >                resubNum = j.runningJob['submission']
425 >            newArgs = "%d %d"%(j.runningJob['jobId'], resubNum)
426              j['arguments'] = newArgs
418            
419        common.bossSession.updateDB(task)
420        return
427  
428 +        common.bossSession.updateDB(task)
429 +        return
430  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines