From 5c0496633cc13d2fa4ab36f9fe9bc97de61298ff Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Mon, 6 Jan 2014 10:56:26 -0600 Subject: [PATCH] Enable reporting of entire runs as dead --- scripts/report.py | 4 ++-- teuthology/report.py | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/scripts/report.py b/scripts/report.py index 3540df8b3632f..6ce2c75fbaa04 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 3b9b4151dfa6f..d50300ecad56d 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')) -- 2.39.5