]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Enable reporting of entire runs as dead
authorZack Cerza <zack@cerza.org>
Mon, 6 Jan 2014 16:56:26 +0000 (10:56 -0600)
committerZack Cerza <zack@cerza.org>
Mon, 6 Jan 2014 17:08:12 +0000 (11:08 -0600)
scripts/report.py
teuthology/report.py

index 3540df8b3632f1eeab313bce3022aef6bef759c9..6ce2c75fbaa049f7200c95364006dc836b349609 100644 (file)
@@ -5,7 +5,7 @@ import teuthology.report
 doc = """
 usage:
     teuthology-report -h
-    teuthology-report [-v] [-R] [-n] [-s SERVER] [-a ARCHIVE] -r RUN ...
+    teuthology-report [-v] [-R] [-n] [-s SERVER] [-a ARCHIVE] [-D] -r RUN ...
     teuthology-report [-v] [-s SERVER] [-a ARCHIVE] [-D] -r RUN -j JOB ...
     teuthology-report [-v] [-R] [-n] [-s SERVER] [-a ARCHIVE] --all-runs
 
@@ -31,7 +31,7 @@ optional arguments:
                         last successful submission in a file called
                         'last_successful_run'. Pass this flag to disable that
                         behavior.
-  -D, --dead            Mark all given jobs with status 'dead'
+  -D, --dead            Mark all given jobs (or entire runs) with status 'dead'
   -v, --verbose         be more verbose
 """.format(archive_base=teuthology.config.config.archive_base)
 
index 3b9b4151dfa6f0e53e84ecbed85ba6374c73803b..d50300ecad56de4d3e14f86322548948f816b0da 100644 (file)
@@ -31,7 +31,10 @@ def main(args):
     run = args['--run']
     job = args['--job']
     dead = args['--dead']
-    if dead and len(run) == 1 and job:
+    if dead and not job:
+        for run_name in run:
+            report_run_dead(run_name, reporter)
+    elif dead and len(run) == 1 and job:
         for job_id in job:
             try_push_job_info(dict(name=run[0], job_id=job_id, status='dead'))
     elif len(run) == 1 and job:
@@ -343,3 +346,12 @@ def try_push_job_info(job_config, extra_info=None):
     except (requests.exceptions.RequestException, socket.error):
         log.exception("Could not report results to %s" %
                       config.results_server)
+
+
+def report_run_dead(run_name, reporter):
+    jobs = reporter.serializer.jobs_for_run(run_name).keys()
+    log.info("Reporting {run} as dead: {count} jobs".format(run=run_name,
+                                                            count=len(jobs)))
+    for job in sorted(jobs):
+        reporter.report_job(run_name, job, dict(name=run_name, job_id=job,
+                                                status='dead'))