From: tierno Date: Tue, 11 Aug 2020 08:58:31 +0000 (+0000) Subject: fix 1182: change general timeout to connect timeout X-Git-Tag: v8.0.1 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=8aad5c8f5b366744a7936a3d0158b2ebffa73cfc;p=osm%2Fosmclient.git fix 1182: change general timeout to connect timeout 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 --- diff --git a/osmclient/sol005/http.py b/osmclient/sol005/http.py index b737894..0228d6a 100644 --- a/osmclient/sol005/http.py +++ b/osmclient/sol005/http.py @@ -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)