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

Unified Diff: tools/buildbot_globals.py

Issue 317823003: Fix submit_try (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 6 years, 6 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/retrieve_from_googlesource.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/buildbot_globals.py
diff --git a/tools/buildbot_globals.py b/tools/buildbot_globals.py
index 1dd781906189f566ff8c53f9a147e0369963717b..bb6c38fc841d553970b27ec04b851bea0d53c285 100755
--- a/tools/buildbot_globals.py
+++ b/tools/buildbot_globals.py
@@ -9,23 +9,19 @@ Provides read access to buildbot's global_variables.json .
"""
-from contextlib import closing
-
import HTMLParser
-import base64
import json
import re
+import retrieve_from_googlesource
import svn
import sys
-import urllib2
_global_vars = None
-_GLOBAL_VARS_JSON_BASE64_URL = (
- 'https://skia.googlesource.com/buildbot/+/master/'
- 'site_config/global_variables.json?format=TEXT')
+SKIABOT_REPO = 'https://skia.googlesource.com/buildbot'
+_GLOBAL_VARS_PATH = 'site_config/global_variables.json'
class GlobalVarsRetrievalError(Exception):
@@ -61,11 +57,11 @@ def Get(var_name):
global _global_vars
if not _global_vars:
try:
- with closing(urllib2.urlopen(_GLOBAL_VARS_JSON_BASE64_URL)) as f:
- global_vars_text = base64.b64decode(f.read())
+ global_vars_text = retrieve_from_googlesource.get(SKIABOT_REPO,
+ _GLOBAL_VARS_PATH)
except Exception as e:
- raise GlobalVarsRetrievalError('Failed to retrieve %s:\n%s' %
- (_GLOBAL_VARS_JSON_BASE64_URL, str(e)))
+ raise GlobalVarsRetrievalError('Failed to retrieve %s from %s:\n%s' %
+ (_GLOBAL_VARS_PATH, SKIABOT_REPO, str(e)))
try:
_global_vars = json.loads(global_vars_text)
except ValueError as e:
« no previous file with comments | « no previous file | tools/retrieve_from_googlesource.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698