From dcd22a532f04eddd0b2f947131d15fe3939be6d7 Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Fri, 11 Jul 2014 14:18:03 -0600 Subject: [PATCH] Add a --dry-run flag to teuthology-schedule Signed-off-by: Zack Cerza --- scripts/schedule.py | 2 ++ teuthology/schedule.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/schedule.py b/scripts/schedule.py index 2fc62cec31926..9d43f0be4d3ed 100644 --- a/scripts/schedule.py +++ b/scripts/schedule.py @@ -33,6 +33,8 @@ optional arguments: --timeout How many seconds to wait for jobs to finish before emailing results. Only applies to the last job in a suite. + --dry-run Instead of scheduling, just output the + job config. """ diff --git a/teuthology/schedule.py b/teuthology/schedule.py index 18dad4921cb38..37bd287024031 100644 --- a/teuthology/schedule.py +++ b/teuthology/schedule.py @@ -1,3 +1,4 @@ +import pprint import yaml import teuthology.beanstalk @@ -14,7 +15,10 @@ def main(args): raise ValueError( '--timeout is only applicable to the last job in a suite') job_config = build_config(args) - schedule_job(job_config, args['--num']) + if args['--dry-run']: + pprint.pprint(job_config) + else: + schedule_job(job_config, args['--num']) def build_config(args): -- 2.39.5