def eraseJob(self, jobSpecId): """ Arguments: JobSpecId -- the job id. Return: none """ logging.info("BossLiteKiller.eraseJob(%s)" % jobSpecId) # kill job self.killJob(jobSpecId, erase=True) # set number of executions to be equal to the maximum number of # allowed retries so jobs will not be resubmitted, or even # not submitted at all if they have not been submitted yet try: JobState.doNotAllowMoreSubmissions([jobSpecId]) except ProdAgentException, ex: msg = "Updating max racers fields failed for job %s\n" % jobSpecId msg += str(ex) logging.error(msg) raise
def __avoidResubmission(self, jobSpecId): """ Set number of executions to be equal to the maximum number of allowed retries so jobs will not be resubmitted, or even not submitted at all if they have not been submitted yet. """ try: JobState.doNotAllowMoreSubmissions([jobSpecId]) except ProdAgentException, ex: msg = "Updating max racers fields failed for job %s\n" % jobSpecId msg += str(ex) logging.error(msg) raise
except BossLiteError, err: msg = "Cannot update job %s, BOSS error: %s" % \ (job['name'], str(err)) logging.error(msg) elif job.runningJob['status'] not in ['C', 'A', 'E']: failed.append( ( job['name'], job.runningJob.errors ) ) logging.info('Warning: job %s in status %s' % \ ( job['name'], job.runningJob['statusScheduler'] ) ) else: logging.info('Skipped job %s in status %s' % \ ( job['name'], job.runningJob['statusScheduler'] ) ) logging.debug("JobSpecId list: "+ str(jobSpecId) + "\n") JobState.doNotAllowMoreSubmissions(jobSpecId) logging.info("Jobs "+ str(killedJobs) +" killed and Archived") logging.debug("Jobs %s are not allowed for further resubmission" \ % str(jobSpecId)) # report failed operations if failed != []: raise Exception( failed ) return def updateStatus(self, task, schedSession): """ update jobs status, bypasing UI bug """