Chromium Code Reviews| 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, |