fix 1182: set timeout of 10s for NBI response 55/9555/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 5 Aug 2020 12:48:02 +0000 (12:48 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 7 Aug 2020 12:26:48 +0000 (12:26 +0000)
Change-Id: I6ba62ef7e1f588443d0fbf2a4025101bccc97464
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osmclient/sol005/http.py

index d130879..b737894 100644 (file)
@@ -24,6 +24,7 @@ from osmclient.common.exceptions import OsmHttpException, NotFound
 
 
 class Http(http.Http):
+    TIMEOUT = 10
 
     def __init__(self, url, user='admin', password='admin', **kwargs):
         self._url = url
@@ -63,6 +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.URL, self._url + endpoint)
         curl_cmd.setopt(pycurl.SSL_VERIFYPEER, 0)
         curl_cmd.setopt(pycurl.SSL_VERIFYHOST, 0)