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

Side by Side Diff: upload_to_google_storage.py

Issue 782643002: Fix upload_to_google_storage.py. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: merge to ToT 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Uploads files to Google Storage content addressed.""" 6 """Uploads files to Google Storage content addressed."""
7 7
8 import hashlib 8 import hashlib
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 bypass_prodaccess=True) 238 bypass_prodaccess=True)
239 else: 239 else:
240 gsutil = None 240 gsutil = None
241 for path in os.environ["PATH"].split(os.pathsep): 241 for path in os.environ["PATH"].split(os.pathsep):
242 if os.path.exists(path) and 'gsutil' in os.listdir(path): 242 if os.path.exists(path) and 'gsutil' in os.listdir(path):
243 gsutil = Gsutil(os.path.join(path, 'gsutil'), boto_path=options.boto) 243 gsutil = Gsutil(os.path.join(path, 'gsutil'), boto_path=options.boto)
244 if not gsutil: 244 if not gsutil:
245 parser.error('gsutil not found in %s, bad depot_tools checkout?' % 245 parser.error('gsutil not found in %s, bad depot_tools checkout?' %
246 GSUTIL_DEFAULT_PATH) 246 GSUTIL_DEFAULT_PATH)
247 247
248 base_url = 'gs://%s' % options.bucket
249
248 # Check we have a valid bucket with valid permissions. 250 # Check we have a valid bucket with valid permissions.
249 base_url, code = check_bucket_permissions(options.bucket, gsutil) 251 code = check_bucket_permissions(base_url, gsutil)
250 if code: 252 if code:
251 return code 253 return code
252 254
253 return upload_to_google_storage( 255 return upload_to_google_storage(
254 input_filenames, base_url, gsutil, options.force, options.use_md5, 256 input_filenames, base_url, gsutil, options.force, options.use_md5,
255 options.num_threads, options.skip_hashing) 257 options.num_threads, options.skip_hashing)
256 258
257 259
258 if __name__ == '__main__': 260 if __name__ == '__main__':
259 sys.exit(main(sys.argv)) 261 sys.exit(main(sys.argv))
OLDNEW
« 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