From e6782c1aa8a118e7042ed3c7136fc777cf77f9e4 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 27 Mar 2015 11:23:16 -0600 Subject: [PATCH] On BranchNotFoundError, mark job as dead We had been simply deleting jobs from paddles if the teuthology branch was not found. Instead, mark them as dead with a useful failure_reason. Signed-off-by: Zack Cerza --- teuthology/worker.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/teuthology/worker.py b/teuthology/worker.py index f94c07e603..be143412c1 100644 --- a/teuthology/worker.py +++ b/teuthology/worker.py @@ -123,13 +123,12 @@ def main(ctx): ceph_branch = job_config.get('branch', 'master') suite_branch = job_config.get('suite_branch', ceph_branch) job_config['suite_path'] = fetch_qa_suite(suite_branch) - except BranchNotFoundError: - log.exception( - "Branch not found; throwing job away") - # Optionally, we could mark the job as dead, but we don't have a - # great way to express why it is dead. - report.try_delete_jobs(job_config['name'], - job_config['job_id']) + except BranchNotFoundError as exc: + log.exception("Branch not found; marking job as dead") + report.try_push_job_info( + job_config, + dict(status='dead', failure_reason=str(exc)) + ) continue teuth_bin_path = os.path.join(teuth_path, 'virtualenv', 'bin') -- 2.39.5