mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-25 07:31:01 +02:00
Fix equals in RunCommand's in cbuildbot.
Change-Id: If8cdde42a470c3d07cfd41552cf95dea7567688b BUG= TEST=Ran cbuildbot. Review URL: http://codereview.chromium.org/3967002
This commit is contained in:
parent
9310bb6bd3
commit
aa4670315b
@ -83,7 +83,7 @@ def _GetAllGitRepos(buildroot, debug=False):
|
|||||||
redirect_stderr=True, print_cmd=debug)
|
redirect_stderr=True, print_cmd=debug)
|
||||||
|
|
||||||
# Extract all lines containg a project.
|
# Extract all lines containg a project.
|
||||||
extract_cmd = ["grep", "project name="]
|
extract_cmd = ['grep', 'project name=']
|
||||||
output = RunCommand(extract_cmd, cwd=buildroot, input=output,
|
output = RunCommand(extract_cmd, cwd=buildroot, input=output,
|
||||||
redirect_stdout=True, print_cmd=debug)
|
redirect_stdout=True, print_cmd=debug)
|
||||||
# Parse line using re to get tuple.
|
# Parse line using re to get tuple.
|
||||||
@ -289,8 +289,8 @@ def _BuildVMImageForTesting(buildroot):
|
|||||||
RunCommand(['./image_to_vm.sh',
|
RunCommand(['./image_to_vm.sh',
|
||||||
'--test_image',
|
'--test_image',
|
||||||
'--full',
|
'--full',
|
||||||
'--vdisk_size %s' % vdisk_size,
|
'--vdisk_size=%s' % vdisk_size,
|
||||||
'--statefulfs_size %s' % statefulfs_size,
|
'--statefulfs_size=%s' % statefulfs_size,
|
||||||
], cwd=cwd, enter_chroot=True)
|
], cwd=cwd, enter_chroot=True)
|
||||||
|
|
||||||
|
|
||||||
@ -303,8 +303,7 @@ def _RunSmokeSuite(buildroot):
|
|||||||
cwd = os.path.join(buildroot, 'src', 'scripts')
|
cwd = os.path.join(buildroot, 'src', 'scripts')
|
||||||
RunCommand(['bin/cros_run_vm_test',
|
RunCommand(['bin/cros_run_vm_test',
|
||||||
'--no_graphics',
|
'--no_graphics',
|
||||||
'--test_case',
|
'--test_case=suite_Smoke',
|
||||||
'suite_Smoke',
|
|
||||||
], cwd=cwd, error_ok=False)
|
], cwd=cwd, error_ok=False)
|
||||||
|
|
||||||
|
|
||||||
@ -356,7 +355,7 @@ def _UprevPush(buildroot):
|
|||||||
cwd = os.path.join(buildroot, 'src', 'scripts')
|
cwd = os.path.join(buildroot, 'src', 'scripts')
|
||||||
RunCommand(['./cros_mark_as_stable', '--srcroot=..',
|
RunCommand(['./cros_mark_as_stable', '--srcroot=..',
|
||||||
'--tracking_branch="cros/master"',
|
'--tracking_branch="cros/master"',
|
||||||
'--push_options', '--bypass-hooks -f', 'push'],
|
'--push_options="--bypass-hooks -f"', 'push'],
|
||||||
cwd=cwd)
|
cwd=cwd)
|
||||||
|
|
||||||
|
|
||||||
|
@ -227,11 +227,11 @@ class VirtualAUTest(unittest.TestCase, AUTest):
|
|||||||
Info('Qemu image not found, creating one.')
|
Info('Qemu image not found, creating one.')
|
||||||
RunCommand(['%s/image_to_vm.sh' % self.crosutils,
|
RunCommand(['%s/image_to_vm.sh' % self.crosutils,
|
||||||
'--full',
|
'--full',
|
||||||
'--from %s' % ReinterpretPathForChroot(
|
'--from=%s' % ReinterpretPathForChroot(
|
||||||
os.path.dirname(base_image_path)),
|
os.path.dirname(base_image_path)),
|
||||||
'--vdisk_size %s' % _FULL_VDISK_SIZE,
|
'--vdisk_size=%s' % _FULL_VDISK_SIZE,
|
||||||
'--statefulfs_size %s' % _FULL_STATEFULFS_SIZE,
|
'--statefulfs_size=%s' % _FULL_STATEFULFS_SIZE,
|
||||||
'--board %s' % board,
|
'--board=%s' % board,
|
||||||
'--test_image'], enter_chroot=True)
|
'--test_image'], enter_chroot=True)
|
||||||
else:
|
else:
|
||||||
Info('Using existing VM image')
|
Info('Using existing VM image')
|
||||||
|
@ -54,8 +54,8 @@ def RunCommand(cmd, print_cmd=True, error_ok=False, error_message=None,
|
|||||||
|
|
||||||
# Print out the command before running.
|
# Print out the command before running.
|
||||||
if print_cmd:
|
if print_cmd:
|
||||||
Info('PROGRAM(%s) -> RunCommand: %s in dir %s' %
|
Info('PROGRAM(%s) -> RunCommand: %r in dir %s' %
|
||||||
(GetCallerName(), ' '.join(cmd), cwd))
|
(GetCallerName(), cmd, cwd))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen(cmd, cwd=cwd, stdin=stdin,
|
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
|
return proc.returncode
|
||||||
|
|
||||||
if not error_ok and 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 ''))
|
(error_message or error or output or ''))
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
if not error_ok:
|
if not error_ok:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user