Change submit_try to use checked-in master_host and master_port

(SkipBuildbotRuns)
Review URL: https://codereview.appspot.com/7719044

git-svn-id: http://skia.googlecode.com/svn/trunk@8072 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tools/submit_try b/tools/submit_try
index 9002d98..8bc5033 100755
--- a/tools/submit_try
+++ b/tools/submit_try
@@ -13,21 +13,37 @@
 """
 
 
+from contextlib import closing
+
 import httplib
 import json
 import os
 import subprocess
 import sys
+import urllib2
+
+
+def GetGlobalVariables():
+  """ Retrieve a global variable from the global_variables.json file. """
+  global_variables_file = ('http://skia.googlecode.com/svn/buildbot/'
+                           'site_config/global_variables.json')
+  with closing(urllib2.urlopen(global_variables_file)) as f:
+    return json.load(f)
+
+
+GLOBAL_VARIABLES = GetGlobalVariables()
+
+
+def GetGlobalVariable(var_name):
+  return GLOBAL_VARIABLES[var_name]['value']
 
 
 # Alias which can be used to run a try on every builder.
 ALL_BUILDERS = 'all'
 
 # Contact information for the build master.
-# TODO(borenet): Share this information from a single location. Filed bug:
-# http://code.google.com/p/skia/issues/detail?id=1081
-SKIA_BUILD_MASTER_HOST = '70.32.156.53'
-SKIA_BUILD_MASTER_PORT = '10117'
+SKIA_BUILD_MASTER_HOST = str(GetGlobalVariable('master_host'))
+SKIA_BUILD_MASTER_PORT = str(GetGlobalVariable('external_port'))
 
 # All try builders have this suffix.
 TRYBOT_SUFFIX = '_Trybot'