]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
On BranchNotFoundError, mark job as dead
authorZack Cerza <zack@redhat.com>
Fri, 27 Mar 2015 17:23:16 +0000 (11:23 -0600)
committerZack Cerza <zack@redhat.com>
Fri, 27 Mar 2015 17:23:16 +0000 (11:23 -0600)
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 <zack@redhat.com>
teuthology/worker.py

index f94c07e603a12f2e5ac1ca43b8602ccb329487ee..be143412c1d07f6feb82321fd3b5e085ec2079be 100644 (file)
@@ -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')