コード例 #1
0
ファイル: jobdb.py プロジェクト: Johnlihj/pbs
 def delete_job(self, jobid=None, job=None, series=False):
     """ qdel job if running, and delete job from the database.
     
          Args:
             jobid: jobid of the job to continue
             job: (sqlite3.Row) If this is given, jobid is not necessary and is ignored if given
             series: If 'series'=True, deletes entire job series
     """
     if job == None:
         job = self.select_job(jobid)
     
     if series == True:
         jobseries = select_series_id(job["jobid"])
     else:
         jobseries = [job["jobid"]]
     
     for j in jobseries:
         misc.delete(j)
         self.curs.execute("DELETE from jobs WHERE jobid=?",(j,))
     self.conn.commit()
コード例 #2
0
ファイル: jobdb.py プロジェクト: tallakahath/pbs
    def delete_job(self, jobid=None, job=None, series=False):
        """ qdel job if running, and delete job from the database.
        
             Args:
                jobid: jobid of the job to continue
                job: (sqlite3.Row) If this is given, jobid is not necessary and is ignored if given
                series: If 'series'=True, deletes entire job series
        """
        if job == None:
            job = self.select_job(jobid)

        if series == True:
            jobseries = select_series_id(job["jobid"])
        else:
            jobseries = [job["jobid"]]

        for j in jobseries:
            misc.delete(j)
            self.curs.execute("DELETE from jobs WHERE jobid=?", (j, ))
        self.conn.commit()
コード例 #3
0
ファイル: jobdb.py プロジェクト: Johnlihj/pbs
 def abort_job(self, jobid=None, job=None):
     """ qdel job and mark job taskstatus as Aborted
         
         Args:
             jobid: jobid of the job to continue
             job: (sqlite3.Row) If this is given, jobid is not necessary and is ignored if given
         
         Raises:
             EligibilityError if job not eligible to be continued
     """
     
     if job == None:
         job = self.select_job(jobid)
     
     eligible, id, msg = self.eligible_to_abort(job)
     if not eligible:
         raise EligibilityError(id, msg)
     
     misc.delete(job["jobid"])
     self.curs.execute("UPDATE jobs SET taskstatus='Aborted', modifytime=? WHERE jobid=?",(int(time.time()),job["jobid"]))
     self.conn.commit()
コード例 #4
0
ファイル: jobdb.py プロジェクト: tallakahath/pbs
    def abort_job(self, jobid=None, job=None):
        """ qdel job and mark job taskstatus as Aborted
            
            Args:
                jobid: jobid of the job to continue
                job: (sqlite3.Row) If this is given, jobid is not necessary and is ignored if given
            
            Raises:
                EligibilityError if job not eligible to be continued
        """

        if job == None:
            job = self.select_job(jobid)

        eligible, id, msg = self.eligible_to_abort(job)
        if not eligible:
            raise EligibilityError(id, msg)

        misc.delete(job["jobid"])
        self.curs.execute(
            "UPDATE jobs SET taskstatus='Aborted', modifytime=? WHERE jobid=?",
            (int(time.time()), job["jobid"]))
        self.conn.commit()