]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Set a default timeout of 20s for HTTP connections
authorZack Cerza <zack@cerza.org>
Fri, 11 Oct 2013 15:23:00 +0000 (10:23 -0500)
committerZack Cerza <zack@cerza.org>
Fri, 11 Oct 2013 15:23:00 +0000 (10:23 -0500)
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
teuthology/report.py

index 6c662819f79767f51c113efdd7befe50bfae90df..ba636d37dcf1092c229fa459d656daedb32d2ffb 100644 (file)
@@ -132,7 +132,8 @@ class ResultsSerializer(object):
 class ResultsReporter(object):
     last_run_file = 'last_successful_run'
 
-    def __init__(self, archive_base, base_uri=None, save=False, refresh=False):
+    def __init__(self, archive_base, base_uri=None, save=False, refresh=False,
+                 timeout=20):
         self.archive_base = archive_base
         self.base_uri = base_uri or config.results_server
         if self.base_uri:
@@ -140,6 +141,7 @@ class ResultsReporter(object):
         self.serializer = ResultsSerializer(archive_base)
         self.save_last_run = save
         self.refresh = refresh
+        self.timeout = timeout
 
     def _do_request(self, uri, method, json_):
         """
@@ -305,7 +307,7 @@ class ResultsReporter(object):
     def http(self):
         if hasattr(self, '__http'):
             return self.__http
-        self.__http = httplib2.Http()
+        self.__http = httplib2.Http(timeout=self.timeout)
         return self.__http