Commit 9010c438 authored by Robert Ma's avatar Robert Ma Committed by Commit Bot

[blinkpy] Suppress stderr of git-cl by default

Bug: 953499
Change-Id: I0f7dfc4317b2de9bc92ef9900dd6888143133a84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1573879
Commit-Queue: Robert Ma <robertma@chromium.org>
Reviewed-by: default avatarLuke Z <lpz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652239}
parent 7ffa5163
...@@ -52,14 +52,22 @@ class GitCL(object): ...@@ -52,14 +52,22 @@ class GitCL(object):
self._cwd = cwd self._cwd = cwd
self._git_executable_name = Git.find_executable_name(host.executive, host.platform) self._git_executable_name = Git.find_executable_name(host.executive, host.platform)
def run(self, args, return_stderr=None): def run(self, args, return_stderr=False):
"""Runs git-cl with the given arguments and returns the output.""" """Runs git-cl with the given arguments and returns the output.
Args:
args: A list of arguments passed to `git cl`.
return_stderr: Whether to include stderr in the returned output (the
default is False because git-cl will show a warning when running
on Swarming bots with local git cache).
Returns:
A string (the output from git-cl).
"""
command = [self._git_executable_name, 'cl'] + args command = [self._git_executable_name, 'cl'] + args
if self._auth_refresh_token_json and args[0] in _COMMANDS_THAT_TAKE_REFRESH_TOKEN: if self._auth_refresh_token_json and args[0] in _COMMANDS_THAT_TAKE_REFRESH_TOKEN:
command += ['--auth-refresh-token-json', self._auth_refresh_token_json] command += ['--auth-refresh-token-json', self._auth_refresh_token_json]
if return_stderr is not None: return self._host.executive.run_command(command, cwd=self._cwd, return_stderr=return_stderr)
return self._host.executive.run_command(command, cwd=self._cwd, return_stderr=return_stderr)
return self._host.executive.run_command(command, cwd=self._cwd)
def trigger_try_jobs(self, builders, bucket=None): def trigger_try_jobs(self, builders, bucket=None):
"""Triggers try jobs on the given builders. """Triggers try jobs on the given builders.
...@@ -103,8 +111,7 @@ class GitCL(object): ...@@ -103,8 +111,7 @@ class GitCL(object):
return 'None' return 'None'
def _get_cl_status(self): def _get_cl_status(self):
# Note: Don't return stderr to address crbug.com/946619 return self.run(['status', '--field=status']).strip()
return self.run(['status', '--field=status'], return_stderr=False).strip()
def wait_for_try_jobs( def wait_for_try_jobs(
self, poll_delay_seconds=10 * 60, timeout_seconds=120 * 60, self, poll_delay_seconds=10 * 60, timeout_seconds=120 * 60,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment