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.59 by spiga, Tue May 26 10:23:00 2009 UTC vs.
Revision 1.65 by riahi, Fri Nov 6 14:25:09 2009 UTC

# Line 206 | Line 206 | class DBinterface:
206          if server_mode == 1:
207              # init client server params...
208              CliServerParams(self)      
209 <            headerTask= "Task Id = %-40s " %(task['name'])
209 >            headerTask = "Task Id = %-40s\n" %(task['name'])
210 >            headerTask+=  '--------------------------------------------------------------------------------------------\n'
211              displayReport(self,headerTask,lines)
212              common.logger.info(showWebMon(self.server_name))
213          if (jid ) or (server_mode == 0):
# Line 215 | Line 216 | class DBinterface:
216                  common.bossSession.getRunningInstance(job)
217                  toPrint = "%-5s %-50s " % (job['jobId'],job.runningJob['schedulerId'])
218                  lines.append(toPrint)
219 <            header+= "%-5s %-50s " % ('Job:','ID' )
219 >            header+= "%-5s %-50s\n " % ('Job:','ID' )
220 >            header+=  '--------------------------------------------------------------------------------------------\n'
221              displayReport(self,header,lines)
222          return  
223  
# Line 316 | Line 318 | class DBinterface:
318              common.bossSession.getNewRunningInstance(job)
319              job.runningJob['status'] = 'C'
320              job.runningJob['statusScheduler'] = 'Created'
321 +            job.runningJob['state'] = 'Created'
322          common.bossSession.updateDB(task)    
323          return        
324  
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 351 | 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 373 | Line 390 | class DBinterface:
390                  job.runningJob['wrapperReturnCode'] = str( rForJ.getAttribute('job_exit') )
391                  job_exit_code = str(job.runningJob['wrapperReturnCode'])
392  
393 <                ## unsing 'standardInput' field for 'ended' tag ['Y','N']
377 <                job['standardInput'] = str( rForJ.getAttribute('ended') )
393 >                job['closed'] = str( rForJ.getAttribute('ended') )
394  
395                  job.runningJob['state'] = str( rForJ.getAttribute('action') )
396            
# Line 390 | Line 406 | class DBinterface:
406      # FIXME temporary method to verify what kind of submission to perform towards the server
407      def checkIfNeverSubmittedBefore(self):
408          for j in self.getTask().jobs:
409 <            if j.runningJob['submission'] > 1 or j.runningJob['status'] != 'C' or \
394 <                    j.runningJob['statusScheduler'] != 'Created':
409 >            if j.runningJob['submission'] > 1 or j.runningJob['state'] != 'Created':
410                  return False
411          return True
412  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines