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

Unified Diff: tools/telemetry/telemetry/util/cloud_storage.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 | « tools/telemetry/telemetry/unittest/system_stub.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/util/cloud_storage.py
diff --git a/tools/telemetry/telemetry/util/cloud_storage.py b/tools/telemetry/telemetry/util/cloud_storage.py
index 274c1dab9f05513591b22ccecd686130d5f8ff7b..ccad47fce92eda765b2b5211fb856f913d847848 100644
--- a/tools/telemetry/telemetry/util/cloud_storage.py
+++ b/tools/telemetry/telemetry/util/cloud_storage.py
@@ -17,17 +17,26 @@ import urllib2
from telemetry.core import platform
from telemetry.util import path
+
PUBLIC_BUCKET = 'chromium-telemetry'
PARTNER_BUCKET = 'chrome-partner-telemetry'
INTERNAL_BUCKET = 'chrome-telemetry'
+BUCKET_ALIASES = {
+ 'public': PUBLIC_BUCKET,
+ 'partner': PARTNER_BUCKET,
+ 'internal': INTERNAL_BUCKET,
+}
+
+
_GSUTIL_URL = 'http://storage.googleapis.com/pub/gsutil.tar.gz'
_DOWNLOAD_PATH = os.path.join(path.GetTelemetryDir(), 'third_party', 'gsutil')
# TODO(tbarzic): A workaround for http://crbug.com/386416 and
# http://crbug.com/359293. See |_RunCommand|.
_CROS_GSUTIL_HOME_WAR = '/home/chromeos-test/'
+
class CloudStorageError(Exception):
@staticmethod
def _GetConfigInstructions(gsutil_path):
@@ -127,6 +136,8 @@ def _RunCommand(args):
'You are attempting to access protected data with no configured',
'Failure: No handler was ready to authenticate.')):
raise CredentialsError(gsutil_path)
+ if 'status=401' in stderr or 'status 401' in stderr:
+ raise CredentialsError(gsutil_path)
if 'status=403' in stderr or 'status 403' in stderr:
raise PermissionError(gsutil_path)
if (stderr.startswith('InvalidUriError') or 'No such object' in stderr or
« no previous file with comments | « tools/telemetry/telemetry/unittest/system_stub.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698