fix 1182: change general timeout to connect timeout 68/9568/1 v8.0.1 v8.0.1rc1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Tue, 11 Aug 2020 08:58:31 +0000 (08:58 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Tue, 11 Aug 2020 09:02:20 +0000 (09:02 +0000)
enlarge timeout from 10 to 15. Sometimes NBI takes many time to respond,
low general timeout is not a good aproach, but connection timeout

Change-Id: I17c67c94cccba83baf6ea56a9225e0674a223c11
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osmclient/sol005/http.py

index b737894..0228d6a 100644 (file)
@@ -24,7 +24,7 @@ from osmclient.common.exceptions import OsmHttpException, NotFound
 
 
 class Http(http.Http):
-    TIMEOUT = 10
+    CONNECT_TIMEOUT = 15
 
     def __init__(self, url, user='admin', password='admin', **kwargs):
         self._url = url
@@ -64,7 +64,7 @@ class Http(http.Http):
             curl_cmd.setopt(pycurl.VERBOSE, True)
         if not skip_query_admin:
             endpoint = self._complete_endpoint(endpoint)
-        curl_cmd.setopt(pycurl.TIMEOUT, self.TIMEOUT)
+        curl_cmd.setopt(pycurl.CONNECTTIMEOUT, self.CONNECT_TIMEOUT)
         curl_cmd.setopt(pycurl.URL, self._url + endpoint)
         curl_cmd.setopt(pycurl.SSL_VERIFYPEER, 0)
         curl_cmd.setopt(pycurl.SSL_VERIFYHOST, 0)