Automated: Migrate gerrit/git-repo from gsutil to gcloud storage

Bug: 486536908
Change-Id: I248b093e189a3784b8959e837a5d66857f1ce0fc
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/577201
Reviewed-by: Gavin Mak <gavinmak@google.com>
Tested-by: Guru sai rama subbarao Voleti (xWF) <gvoleti@google.com>
Commit-Queue: Guru sai rama subbarao Voleti (xWF) <gvoleti@google.com>
This commit is contained in:
gurusai-voleti
2026-04-27 08:15:09 +00:00
committed by gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com
parent 51021fb209
commit a94c9e2b52
2 changed files with 11 additions and 10 deletions
+4 -3
View File
@@ -34,7 +34,7 @@ def fetch_file(url, verbose=False):
"""
scheme = urlparse(url).scheme
if scheme == "gs":
cmd = ["gsutil", "cat", url]
cmd = ["gcloud", "storage", "cat", url]
errors = []
try:
result = subprocess.run(
@@ -42,7 +42,7 @@ def fetch_file(url, verbose=False):
)
if result.stderr and verbose:
print(
'warning: non-fatal error running "gsutil": %s'
'warning: non-fatal error running "gcloud storage": %s'
% result.stderr,
file=sys.stderr,
)
@@ -50,7 +50,8 @@ def fetch_file(url, verbose=False):
except subprocess.CalledProcessError as e:
errors.append(e)
print(
'fatal: error running "gsutil": %s' % e.stderr, file=sys.stderr
'fatal: error running "gcloud storage": %s' % e.stderr,
file=sys.stderr,
)
raise FetchFileError(aggregate_errors=errors)
with urlopen(url) as f: