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
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)
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:
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'))