]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Add a --dry-run flag to teuthology-schedule
authorZack Cerza <zack@cerza.org>
Fri, 11 Jul 2014 20:18:03 +0000 (14:18 -0600)
committerZack Cerza <zack@cerza.org>
Fri, 11 Jul 2014 20:18:03 +0000 (14:18 -0600)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
scripts/schedule.py
teuthology/schedule.py

index 2fc62cec3192645463fb5160a6a968674b7ccb08..9d43f0be4d3ed4ed7f7432f36bbd15abcc9a3971 100644 (file)
@@ -33,6 +33,8 @@ optional arguments:
   --timeout <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.
 
 """
 
index 18dad4921cb38329acd83e38a02deda43daf75d7..37bd287024031ddd0216813ac0948ebc93ce9d58 100644 (file)
@@ -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):