]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
With dry_run, quote any individual args
authorZack Cerza <zack@cerza.org>
Thu, 19 Jun 2014 19:54:05 +0000 (15:54 -0400)
committerZack Cerza <zack@cerza.org>
Wed, 25 Jun 2014 18:54:23 +0000 (12:54 -0600)
So that individual commands can be copied and pasted
in order to execute them individually.

Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/suite.py

index a06b3865d477055b2bb345412b34a267f2efad54..cc18ab09cd19d06b4c8bf75babbc83eb0e3369df 100644 (file)
@@ -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,