Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(419)

Unified Diff: download_from_google_storage.py

Issue 772203002: Don't check bucket permissions if --no-auth. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: download_from_google_storage.py
diff --git a/download_from_google_storage.py b/download_from_google_storage.py
index ffdd4ee97893ee7fb6e25e3a9cdc3be01268f838..4545a95571558aa5160bac866fa31214d865befb 100755
--- a/download_from_google_storage.py
+++ b/download_from_google_storage.py
@@ -110,12 +110,7 @@ class Gsutil(object):
return (code, out, err)
-def check_bucket_permissions(bucket, gsutil):
- if not bucket:
- print >> sys.stderr, 'Missing bucket %s.'
- return (None, 1)
- base_url = 'gs://%s' % bucket
-
+def check_bucket_permissions(base_url, gsutil):
code, _, ls_err = gsutil.check_call('ls', base_url)
if code != 0:
print >> sys.stderr, ls_err
@@ -457,10 +452,13 @@ def main(args):
parser.error('Output file %s exists and --no_resume is specified.'
% options.output)
+ base_url = 'gs://%s' % options.bucket
iannucci 2014/12/04 19:35:21 hah, I guess we already have a check for `not opti
+
# Check we have a valid bucket with valid permissions.
- base_url, code = check_bucket_permissions(options.bucket, gsutil)
- if code:
- return code
+ if not options.no_auth:
+ code = check_bucket_permissions(base_url, gsutil, options.no_auth)
agable 2014/12/04 22:38:24 This is causing errors: sending three arguments to
+ if code:
+ return code
return download_from_google_storage(
input_filename, base_url, gsutil, options.num_threads, options.directory,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698