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/upload_symbols.py b/scripts/upload_symbols.py
index 51a4947..c3871a4 100644
--- a/scripts/upload_symbols.py
+++ b/scripts/upload_symbols.py
@@ -130,7 +130,7 @@
# Randomly fail 80% of the time (the retry logic makes this 80%/3 per file).
returncode = random.randint(1, 100) <= 80
cros_build_lib.Debug('would run (and return %i): %s', returncode,
- ' '.join(map(repr, cmd)))
+ cros_build_lib.CmdToStr(cmd))
if returncode:
output = 'Failed to send the symbol file.'
else: