diff --git a/gsutil.py b/gsutil.py index 7642625b3..ffdf9cb9f 100755 --- a/gsutil.py +++ b/gsutil.py @@ -260,10 +260,13 @@ def run_gsutil(target, args, clean=False): # Notify user that their .boto file might be outdated. if b'Your credentials are invalid.' in p.stderr: + # Make sure this error message is visible when invoked by gclient runhooks + separator = '*' * 80 print( + '\n' + separator + '\n' + 'Warning: You might have an outdated .boto file. If this issue ' 'persists after running `gsutil.py config`, try removing your ' - '.boto file.', + '.boto file.\n' + separator + '\n', file=sys.stderr) _print_subprocess_result(p) diff --git a/win_toolchain/get_toolchain_if_necessary.py b/win_toolchain/get_toolchain_if_necessary.py index aa556cba4..6b25ad7e7 100755 --- a/win_toolchain/get_toolchain_if_necessary.py +++ b/win_toolchain/get_toolchain_if_necessary.py @@ -26,7 +26,6 @@ import hashlib import filecmp import json import os -import platform import shutil import subprocess import sys @@ -257,7 +256,11 @@ def CanAccessToolchainBucket(): """Checks whether the user has access to gs://chrome-wintoolchain/.""" gsutil = download_from_google_storage.Gsutil( download_from_google_storage.GSUTIL_DEFAULT_PATH, boto_path=None) - code, _, _ = gsutil.check_call('ls', 'gs://chrome-wintoolchain/') + code, stdout, stderr = gsutil.check_call('ls', 'gs://chrome-wintoolchain/') + if code != 0: + # Make sure any error messages are made visible to the user. + print(stderr, file=sys.stderr, end='') + print(stdout, end='') return code == 0