So that individual commands can be copied and pasted
in order to execute them individually.
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
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,