diff --git a/bin/cbuildbot.py b/bin/cbuildbot.py index bc6e6696a7..d0c796ec67 100755 --- a/bin/cbuildbot.py +++ b/bin/cbuildbot.py @@ -83,7 +83,7 @@ def _GetAllGitRepos(buildroot, debug=False): redirect_stderr=True, print_cmd=debug) # Extract all lines containg a project. - extract_cmd = ["grep", "project name="] + extract_cmd = ['grep', 'project name='] output = RunCommand(extract_cmd, cwd=buildroot, input=output, redirect_stdout=True, print_cmd=debug) # Parse line using re to get tuple. @@ -289,8 +289,8 @@ def _BuildVMImageForTesting(buildroot): RunCommand(['./image_to_vm.sh', '--test_image', '--full', - '--vdisk_size %s' % vdisk_size, - '--statefulfs_size %s' % statefulfs_size, + '--vdisk_size=%s' % vdisk_size, + '--statefulfs_size=%s' % statefulfs_size, ], cwd=cwd, enter_chroot=True) @@ -303,8 +303,7 @@ def _RunSmokeSuite(buildroot): cwd = os.path.join(buildroot, 'src', 'scripts') RunCommand(['bin/cros_run_vm_test', '--no_graphics', - '--test_case', - 'suite_Smoke', + '--test_case=suite_Smoke', ], cwd=cwd, error_ok=False) @@ -356,7 +355,7 @@ def _UprevPush(buildroot): cwd = os.path.join(buildroot, 'src', 'scripts') RunCommand(['./cros_mark_as_stable', '--srcroot=..', '--tracking_branch="cros/master"', - '--push_options', '--bypass-hooks -f', 'push'], + '--push_options="--bypass-hooks -f"', 'push'], cwd=cwd) diff --git a/bin/cros_au_test_harness.py b/bin/cros_au_test_harness.py index 799a5240c8..41baf21268 100755 --- a/bin/cros_au_test_harness.py +++ b/bin/cros_au_test_harness.py @@ -227,11 +227,11 @@ class VirtualAUTest(unittest.TestCase, AUTest): Info('Qemu image not found, creating one.') RunCommand(['%s/image_to_vm.sh' % self.crosutils, '--full', - '--from %s' % ReinterpretPathForChroot( + '--from=%s' % ReinterpretPathForChroot( os.path.dirname(base_image_path)), - '--vdisk_size %s' % _FULL_VDISK_SIZE, - '--statefulfs_size %s' % _FULL_STATEFULFS_SIZE, - '--board %s' % board, + '--vdisk_size=%s' % _FULL_VDISK_SIZE, + '--statefulfs_size=%s' % _FULL_STATEFULFS_SIZE, + '--board=%s' % board, '--test_image'], enter_chroot=True) else: Info('Using existing VM image') diff --git a/lib/cros_build_lib.py b/lib/cros_build_lib.py index 47c8f96ae6..509871c6ee 100644 --- a/lib/cros_build_lib.py +++ b/lib/cros_build_lib.py @@ -54,8 +54,8 @@ def RunCommand(cmd, print_cmd=True, error_ok=False, error_message=None, # Print out the command before running. if print_cmd: - Info('PROGRAM(%s) -> RunCommand: %s in dir %s' % - (GetCallerName(), ' '.join(cmd), cwd)) + Info('PROGRAM(%s) -> RunCommand: %r in dir %s' % + (GetCallerName(), cmd, cwd)) try: proc = subprocess.Popen(cmd, cwd=cwd, stdin=stdin, @@ -65,7 +65,7 @@ def RunCommand(cmd, print_cmd=True, error_ok=False, error_message=None, return proc.returncode if not error_ok and proc.returncode: - raise Exception('Command "%s" failed.\n' % (' '.join(cmd)) + + raise Exception('Command "%r" failed.\n' % (cmd) + (error_message or error or output or '')) except Exception, e: if not error_ok: