Exemple #1
0
def execute_job(job_id, run_number):
    job = Job.get_job(job_id)
    if not job:
        return

    job_execution = JobExecution.get_job(run_number)

    for action in job.actions:
        plugin = get_action_plugin(ACTION_PLUGINS, action.action_type)

        if plugin:
            plugin.execute_action(job, action)
        else:
            job_execution.status = 'error'
            JobExecution.update_job(job_execution)
            print('Failed to execute action: {0}'.format(action.action_type))

    if job_execution.status == 'in-progress':
        job_execution.status = 'complete'
        JobExecution.update_job(job_execution)
Exemple #2
0
def execute_job(job_id, run_number):
    job = Job.get_job(job_id)
    if not job:
        return

    job_execution = JobExecution.get_job(run_number)

    for action in job.actions:
        plugin = get_action_plugin(ACTION_PLUGINS, action.action_type)

        if plugin:
            plugin.execute_action(job, action)
        else:
            job_execution.status = 'error'
            JobExecution.update_job(job_execution)
            print('Failed to execute action: {0}'.format(action.action_type))

    if job_execution.status == 'in-progress':
        job_execution.status = 'complete'
        JobExecution.update_job(job_execution)
 def can_update(self):
     JobExecution.update_job(self.job_ex, handler=self.handler)
     expect(len(self.handler.update_document.calls)).to.equal(1)
Exemple #4
0
 def can_update(self):
     JobExecution.update_job(self.job_ex, handler=self.handler)
     expect(len(self.handler.update_document.calls)).to.equal(1)