diff options
author | borenet@google.com <borenet@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-02 20:27:16 +0000 |
---|---|---|
committer | borenet@google.com <borenet@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-02 20:27:16 +0000 |
commit | 4b897fa1f6f2f3c2319699545c6e3b8d3c82db17 (patch) | |
tree | 77b8871488407a682af68f511637d2a3577dc963 /tools | |
parent | 5092adc5461a7c5cb3e1fad01be2174c3f4a0c46 (diff) |
Add some debugging to buildbot_globals, sort the trybot list
R=epoger@google.com, rmistry@google.com
Review URL: https://codereview.chromium.org/99223002
git-svn-id: http://skia.googlecode.com/svn/trunk@12437 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/buildbot_globals.py | 34 | ||||
-rwxr-xr-x | tools/submit_try | 2 |
2 files changed, 32 insertions, 4 deletions
diff --git a/tools/buildbot_globals.py b/tools/buildbot_globals.py index 1dcb1ccc09..c3d2227396 100755 --- a/tools/buildbot_globals.py +++ b/tools/buildbot_globals.py @@ -13,17 +13,45 @@ import svn _global_vars = None + +GLOBAL_VARS_JSON_URL = ( + 'http://skia.googlecode.com/svn/buildbot/site_config/global_variables.json') + + +class GlobalVarsRetrievalError(Exception): + """Exception which is raised when the global_variables.json file cannot be + retrieved from the Skia buildbot repository.""" + pass + + +class JsonDecodeError(Exception): + """Exception which is raised when the global_variables.json file cannot be + interpreted as JSON. This may be due to the file itself being incorrectly + formatted or due to an incomplete or corrupted downloaded version of the file. + """ + pass + + class NoSuchGlobalVariable(KeyError): + """Exception which is raised when a given variable is not found in the + global_variables.json file.""" pass + def Get(var_name): '''Return the value associated with this name in global_variables.json. Raises NoSuchGlobalVariable if there is no variable with that name.''' global _global_vars if not _global_vars: - _global_vars = json.loads(svn.Cat('http://skia.googlecode.com/svn/' - 'buildbot/site_config/' - 'global_variables.json')) + try: + global_vars_text = svn.Cat(GLOBAL_VARS_JSON_URL) + except Exception: + raise GlobalVarsRetrievalError('Failed to retrieve %s.' % + GLOBAL_VARS_JSON_URL) + try: + _global_vars = json.loads(global_vars_text) + except ValueError as e: + raise JsonDecodeError(e.message + '\n' + global_vars_text) try: return _global_vars[var_name]['value'] except KeyError: diff --git a/tools/submit_try b/tools/submit_try index da9292a671..840a06487f 100755 --- a/tools/submit_try +++ b/tools/submit_try @@ -172,7 +172,7 @@ submit_try %s--bot <buildername> [<buildername> ...] if arg == '-h' or arg == '--help': Error() elif arg == '-l' or arg == '--list_bots': - format_args = ['\n '.join(trybots)] + ALL_ALIASES + format_args = ['\n '.join(sorted(trybots))] + ALL_ALIASES print ( """ submit_try: Available builders:\n %s |