From: Zack Cerza Date: Mon, 6 Jan 2014 16:56:26 +0000 (-0600) Subject: Enable reporting of entire runs as dead X-Git-Tag: 1.1.0~1701 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5c0496633cc13d2fa4ab36f9fe9bc97de61298ff;p=teuthology.git Enable reporting of entire runs as dead --- diff --git a/scripts/report.py b/scripts/report.py index 3540df8b36..6ce2c75fba 100644 --- a/scripts/report.py +++ b/scripts/report.py @@ -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) diff --git a/teuthology/report.py b/teuthology/report.py index 3b9b4151df..d50300ecad 100644 --- a/teuthology/report.py +++ b/teuthology/report.py @@ -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'))