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.23 by farinafa, Fri May 9 13:33:34 2008 UTC vs.
Revision 1.28 by farinafa, Tue May 20 16:59:51 2008 UTC

# Line 34 | Line 34 | class DBinterface:
34              raise CrabException('Istantiate DB Session : '+str(e))
35  
36          try:
37 <            common.bossSession.installDB('$CRABPRODCOMMONPYTHON/ProdCommon/BossLite/DbObjects/setupDatabase-sqlite.sql')    
37 >            common.bossSession.bossLiteDB.installDB('$CRABPRODCOMMONPYTHON/ProdCommon/BossLite/DbObjects/setupDatabase-sqlite.sql')
38          except Exception, e :
39              raise CrabException('DB Installation error : '+str(e))
40          return
# Line 180 | Line 180 | class DBinterface:
180          Jobs = task.getJobs()
181          print "--------------------------"
182          for Job in Jobs:
183 <            print "Id: ",Job['id']
183 >            print "Id: ",Job['jobId']
184              print "Dest: ", Job['dlsDestination']
185              print "Output: ", Job['outputFiles']
186              print "Args: ",Job['arguments']
# Line 206 | Line 206 | class DBinterface:
206              for job in task.jobs:
207                  toPrint=''
208                  common.bossSession.getRunningInstance(job)
209 <                toPrint = "%-5s %-50s " % (job['id'],job.runningJob['schedulerId'])
209 >                toPrint = "%-5s %-50s " % (job['jobId'],job.runningJob['schedulerId'])
210                  lines.append(toPrint)
211              header+= "%-5s %-50s " % ('Job:','ID' )
212          displayReport(self,header,lines)
# Line 306 | Line 306 | class DBinterface:
306          task = self.getTask(nj)
307  
308          for job in task.jobs:
309 <            if job.runningJob is not None :
310 <                job.runningJob["closed"] = "Y"
311 <
312 <        common.bossSession.updateDB(task)
313 <
314 <        for job in task.jobs:
315 <            job.runningJob = None
316 <            common.bossSession.getRunningInstance(job)
309 >            common.bossSession.getNewRunningInstance(job)
310 >            job.runningJob['status'] = 'C'
311 >            job.runningJob['statusScheduler'] = 'Created'
312 >        common.bossSession.updateDB(task)    
313          return        
314  
315      def deserXmlStatus(self, reportList):
# Line 322 | Line 318 | class DBinterface:
318  
319          for job in task.jobs:
320              if not job.runningJob:
321 <                raise CrabException( "Missing running object for job %s"%str(job['id']) )
321 >                raise CrabException( "Missing running object for job %s"%str(job['jobId']) )
322  
323 <            id = str(job.runningJob['id'])
323 >            id = str(job.runningJob['jobId'])
324              # TODO linear search, probably it can be optized with binary search
325              rForJ = None
326              for r in reportList:
# Line 358 | Line 354 | class DBinterface:
354          common.bossSession.updateDB( task )
355  
356          return
357 +
358 +    # FIXME temporary method to verify what kind of submission to perform towards the server
359 +    def checkIfNeverSubmittedBefore(self):
360 +        for j in self.getTask().jobs:
361 +            if j.runningJob['submission'] > 1 or j.runningJob['status'] != 'C':
362 +                return False
363 +        return True
364 +
365 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines