mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-31 10:11:17 +00:00
framework/execution: Factor out skip_job method
This also fixes the missing housekeeping when skipping a job due to phones_home
This commit is contained in:
parent
ccaeb5a142
commit
4a001713bb
@ -174,12 +174,15 @@ class ExecutionContext(object):
|
||||
self.run_state.update_job(job)
|
||||
self.run_output.write_state()
|
||||
|
||||
def skip_job(self, job):
|
||||
job.status = Status.SKIPPED
|
||||
self.run_state.update_job(job)
|
||||
self.completed_jobs.append(job)
|
||||
|
||||
def skip_remaining_jobs(self):
|
||||
while self.job_queue:
|
||||
job = self.job_queue.pop(0)
|
||||
job.status = Status.SKIPPED
|
||||
self.run_state.update_job(job)
|
||||
self.completed_jobs.append(job)
|
||||
self.skip_job(job)
|
||||
self.write_state()
|
||||
|
||||
def write_state(self):
|
||||
@ -421,7 +424,7 @@ class Runner(object):
|
||||
if job.workload.phones_home and not rc.allow_phone_home:
|
||||
self.logger.warning('Skipping job {} ({}) due to allow_phone_home=False'
|
||||
.format(job.id, job.workload.name))
|
||||
job.set_status(Status.SKIPPED)
|
||||
self.context.skip_job(job)
|
||||
return
|
||||
|
||||
job.set_status(Status.RUNNING)
|
||||
|
Loading…
x
Reference in New Issue
Block a user