Commit faf6addc authored by dpranke@chromium.org's avatar dpranke@chromium.org

Fix check preventing gsutil from being included in standalone telemetry.

We were checking if 'prodaccess' is in the path when trying to decide
if 'gsutil' supported prodaccess; when we called this as part of
the find_dependencies script, this meant that we wouldn't include gsutil
because prodaccess wasn't on the bot.

We really only want the path check to happen when we're handling an
authorization failure, in order to determine what message to show the
user.

This CL fixes this issue.

R=nduca@chromium.org, dtu@chromium.org
BUG=369350

Review URL: https://codereview.chromium.org/291293002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272091 0039d316-1c4b-4281-b951-d872f2087c98
parent ebe0777a
......@@ -28,7 +28,7 @@ _DOWNLOAD_PATH = os.path.join(util.GetTelemetryDir(), 'third_party', 'gsutil')
class CloudStorageError(Exception):
@staticmethod
def _GetConfigInstructions(gsutil_path):
if SupportsProdaccess(gsutil_path):
if SupportsProdaccess(gsutil_path) and _FindExecutableInPath('prodaccess'):
return 'Run prodaccess to authenticate.'
else:
return ('To configure your credentials:\n'
......@@ -92,11 +92,8 @@ def FindGsutil():
def SupportsProdaccess(gsutil_path):
def GsutilSupportsProdaccess():
with open(gsutil_path, 'r') as gsutil:
return 'prodaccess' in gsutil.read()
return _FindExecutableInPath('prodaccess') and GsutilSupportsProdaccess()
with open(gsutil_path, 'r') as gsutil:
return 'prodaccess' in gsutil.read()
def _RunCommand(args):
......
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