From: Zack Cerza Date: Thu, 19 Jun 2014 19:54:05 +0000 (-0400) Subject: With dry_run, quote any individual args X-Git-Tag: 1.1.0~1379 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fd13a18c8324d58bb15e964a51e03a1c35232c28;p=teuthology.git With dry_run, quote any individual args So that individual commands can be copied and pasted in order to execute them individually. Signed-off-by: Zack Cerza --- diff --git a/teuthology/suite.py b/teuthology/suite.py index a06b3865d..cc18ab09c 100644 --- a/teuthology/suite.py +++ b/teuthology/suite.py @@ -379,7 +379,15 @@ def schedule_suite(name, arg.extend(config) if dry_run: - log.info('dry-run: %s' % ' '.join(arg)) + # Quote any individual args so that individual commands can be + # copied and pasted in order to execute them individually. + printable_args = [] + for item in arg: + if ' ' in item: + printable_args.append("'%s'" % item) + else: + printable_args.append(item) + log.info('dry-run: %s' % ' '.join(printable_args)) else: subprocess.check_call( args=arg,