Add gsutil.py config hint to 401 GCS error message

This CL adds a hint on how to log into GCS to the 401 error message
displayed to the user.

Bug: 381634957
Change-Id: Id72b5030c018b28a7297b7ff3f279485c6da4d9e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6056844
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Alan Cutter <alancutter@chromium.org>
changes/44/6056844/2
Alan Cutter 8 months ago committed by LUCI CQ
parent b4aca760e2
commit d215a68912

@ -143,7 +143,8 @@ class Gsutil(object):
if status_code_match:
return (int(status_code_match.group(1)), out, err)
if ('ServiceException: 401 Anonymous' in err):
return (401, out, err)
return (401, out, err + '\nTry running "gsutil.py config" to log '
' into Google Cloud Storage.')
if ('You are attempting to access protected data with '
'no configured credentials.' in err):
return (403, out, err)

Loading…
Cancel
Save