From d215a68912de26d84752e56880827c856486e62d Mon Sep 17 00:00:00 2001 From: Alan Cutter Date: Mon, 2 Dec 2024 22:55:21 +0000 Subject: [PATCH] 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 Commit-Queue: Alan Cutter --- download_from_google_storage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/download_from_google_storage.py b/download_from_google_storage.py index f3fc51cb87..bfc8eace2c 100755 --- a/download_from_google_storage.py +++ b/download_from_google_storage.py @@ -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)