cros_build_lib: Add function for translating command to string.
This creates a helper function to standardize how command lists are
translated to strings for output in log messages. As part of this
change, it switches from using
repr(arg)
to
repr(str(arg))
This still puts single quotes around each command argument and handles
internal quotes with backslashes. The str call deals with removing the
"u" prefix that repr puts before unicode strings.
BUG=None
TEST=new unittest passes
TEST=trybot of x86-generic-full shows log messages with same syntax as
before.
Change-Id: I33dc738a2d2d98cdb134d89796890cc003b2bc31
Reviewed-on: https://chromium-review.googlesource.com/181053
Reviewed-by: Matt Tennant <mtennant@chromium.org>
Commit-Queue: Matt Tennant <mtennant@chromium.org>
Tested-by: Matt Tennant <mtennant@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index ecd72eb..7b0b35e 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -764,8 +764,8 @@
return False
- cros_build_lib.Info("cbuildbot was executed with args %s"
- % ' '.join(map(repr, sys.argv)))
+ cros_build_lib.Info('cbuildbot was executed with args %s' %
+ cros_build_lib.CmdToStr(sys.argv))
chrome_rev = build_config['chrome_rev']
if options.chrome_rev: