]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
schedule: print yaml_dump instead of pprint
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Sun, 10 May 2020 12:20:33 +0000 (14:20 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 6 Jul 2020 16:38:31 +0000 (18:38 +0200)
This will allow to redirect output of dry-run to a file
which will produce a multi-document yaml, and can be
parsed easily afterwards.

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
teuthology/schedule.py

index 309f68be4d4906b297b300aeb47a61f7d6abf47d..f8206cf0179578325eaa433174957ba84fd36fbd 100644 (file)
@@ -1,4 +1,3 @@
-import pprint
 import yaml
 
 import teuthology.beanstalk
@@ -33,7 +32,7 @@ def main(args):
         raise ValueError("Please use a more descriptive value for --name")
     job_config = build_config(args)
     if args['--dry-run']:
-        pprint.pprint(job_config)
+        print('---\n' + yaml.safe_dump(job_config))
     else:
         schedule_job(job_config, args['--num'], report_status)