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

Unified Diff: tools/perf/page_sets/PRESUBMIT.py

Issue 556003002: [telemetry] Use consistent bucket naming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit tests. Created 6 years, 3 months 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 | tools/telemetry/cloud_storage » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/page_sets/PRESUBMIT.py
diff --git a/tools/perf/page_sets/PRESUBMIT.py b/tools/perf/page_sets/PRESUBMIT.py
index faf0503d0e15c7565996422a9c5dcc26f114a9b3..cf39ca1fcc2a0289acaec45819573b9ca89a5029 100644
--- a/tools/perf/page_sets/PRESUBMIT.py
+++ b/tools/perf/page_sets/PRESUBMIT.py
@@ -82,17 +82,15 @@ def _SyncFilesToCloud(input_api, output_api):
continue
try:
- bucket_input = raw_input('Uploading to Cloud Storage: %s\n'
- 'Is this file [P]ublic or Google-[i]nternal?'
- % file_path).lower()
- if 'public'.startswith(bucket_input):
- bucket = cloud_storage.PUBLIC_BUCKET
- elif ('internal'.startswith(bucket_input) or
- 'google-internal'.startswith(bucket_input)):
- bucket = cloud_storage.INTERNAL_BUCKET
- else:
+ bucket_aliases_string = ', '.join(cloud_storage.BUCKET_ALIASES)
+ bucket_input = raw_input(
+ 'Uploading to Cloud Storage: %s\n'
+ 'Which bucket should this go in? (%s) '
+ % (file_path, bucket_aliases_string)).lower()
+ bucket = cloud_storage.BUCKET_ALIASES.get(bucket_input, None)
+ if not bucket:
results.append(output_api.PresubmitError(
- 'Response was neither "public" nor "internal": %s' % bucket_input))
+ '"%s" was not one of %s' % (bucket_input, bucket_aliases_string)))
return results
cloud_storage.Insert(bucket, file_hash, file_path)
« no previous file with comments | « no previous file | tools/telemetry/cloud_storage » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698