crosperf: RunCommand should return one type of object.
Cleaned up the interfaces for the RunCommand routines.
These were returning different types (int or tuple) depending on
the value of the return_ouput parameter.
Returning different unrelated types from a routine is bad practice.
Linter complains about this with several warnings like this:
"Attempting to unpack a non-sequence defined at line XY of
utils.command_executer"
BUG=chromium:566256
TEST=ran crosperf with a example experiment file
Ran run_tests.
Change-Id: Ibb83ab9322c87558077fc4937ef5c0686bbe5417
Reviewed-on: https://chrome-internal-review.googlesource.com/241459
Commit-Ready: Luis Lozano <llozano@chromium.org>
Tested-by: Luis Lozano <llozano@chromium.org>
Reviewed-by: Han Shen <shenhan@google.com>
diff --git a/auto_delete_nightly_test_data.py b/auto_delete_nightly_test_data.py
index 17e67e7..f8eaeac 100755
--- a/auto_delete_nightly_test_data.py
+++ b/auto_delete_nightly_test_data.py
@@ -47,8 +47,7 @@
if dry_run:
print cmd
else:
- if ce.RunCommand(cmd, return_output=False, print_to_console=False,
- terminated_timeout=480) == 0:
+ if ce.RunCommand(cmd, print_to_console=False, terminated_timeout=480) == 0:
print 'Successfully removed "{0}".'.format(s)
else:
all_succeeded = False
@@ -97,7 +96,7 @@
r'-amin +1440 '
r'-exec bash -c "echo rm -fr {{}}" \; '
r'-exec bash -c "rm -fr {{}}" \;').format(chromeos_chroot_tmp)
- rv = ce.RunCommand(cmd, return_output=False, print_to_console=False)
+ rv = ce.RunCommand(cmd, print_to_console=False)
if rv == 0:
print ('Successfully cleaned chromeos tree tmp directory '
'"{0}".'.format(chromeos_chroot_tmp))
@@ -113,7 +112,7 @@
r' -name "chromiumos_test_image.bin" -amin +1440 \) '
r'-exec bash -c "echo rm -f {{}}" \; '
r'-exec bash -c "rm -f {{}}" \;').format(chromeos_chroot_tmp)
- rv2 = ce.RunCommand(cmd, return_output=False, print_to_console=False)
+ rv2 = ce.RunCommand(cmd, print_to_console=False)
if rv2 == 0:
print 'Successfully cleaned chromeos images.'
else: