def resubmitSingleJob(self, job): MU.logMsg(self, 'Attempting to re-submit Martin job %s' % job.jobID, 'info') jobData = {'tSelectedJob': str(job.jobID)} params = {'job_data': json.dumps(jobData)} # Submit the job conn = SecondaryServerConnector(self.server) resp = conn.makeRequest('/resubmitJob', 'POST', params) if not resp.get('success') == False: MU.logMsg(self, 'Resubmitting Martin Job %s' % job.jobID, mode='info') return job.jobID else: MU.logMsg(self, 'Job Re-Submission Failed: %s' % resp.get('errorMsg'), 'error')
def submitSingleJob(self, job, projID='None'): MU.logMsg(self, 'Attempting to submit milhouse secondary job %s to Martin server' % job.id, 'info') jobData = self._modelToSubmissionDict(job, projID) ref = job.reference #job.reference.get('name') jobData['useLIMST'] = True if 'limstemplate' in ref.lower() else False # Submit the job params = {'job_data': json.dumps(jobData)} conn = SecondaryServerConnector(self.server) resp = conn.makeRequest('/JobService/submit', 'POST', params) print 'RESPONSE IS', resp if not resp.get('success') == False: jobID = resp['job_id'] MU.logMsg(self, 'Saving Martin Job ID: %s' % jobID, 'info') job.jobID = jobID job.save() return jobID else: MU.logMsg(self, 'Job Submission Failed. ErrorMsg: %s' % resp.get('errorMsg'), 'error')