Index: tools/push-to-trunk/common_includes.py |
diff --git a/tools/push-to-trunk/common_includes.py b/tools/push-to-trunk/common_includes.py |
index 482509f7d1974e9fbf946c6995be33caae920e76..86d33ca0c0508c8711612a73d5499f2987b0f439 100644 |
--- a/tools/push-to-trunk/common_includes.py |
+++ b/tools/push-to-trunk/common_includes.py |
@@ -28,6 +28,7 @@ |
import argparse |
import datetime |
+import httplib |
import imp |
import json |
import os |
@@ -207,6 +208,25 @@ class SideEffectHandler(object): # pragma: no cover |
finally: |
url_fh.close() |
+ def ReadClusterFuzzAPI(self, api_key, **params): |
+ params["api_key"] = api_key |
+ params = urllib.urlencode(params) |
+ |
+ headers = {"Content-type": "application/x-www-form-urlencoded"} |
+ |
+ conn = httplib.HTTPSConnection("backend-dot-cluster-fuzz.appspot.com") |
+ conn.request("POST", "/_api/", params, headers) |
+ |
+ response = conn.getresponse() |
+ data = response.read() |
+ |
+ try: |
+ return json.loads(data) |
+ except: |
+ print data |
+ print "ERROR: Could not read response. Is your key valid?" |
+ raise |
+ |
def Sleep(self, seconds): |
time.sleep(seconds) |