http client: ensure timeout is an int

It could otherwise lead to errors like:
    Timeout value connect was 15, but it must be an int, float or None

Change-Id: I7b426c88a09f27ca2d645fd05227c2cf106d8d1e
This commit is contained in:
David Moreau Simard 2020-09-30 10:59:48 -04:00
parent e7619066f1
commit d957ab9552
No known key found for this signature in database
GPG Key ID: 7D4729EC4E64E8B7

View File

@ -36,7 +36,7 @@ class HttpClient(object):
self.endpoint = endpoint.rstrip("/")
self.auth = auth
self.timeout = timeout
self.timeout = int(timeout)
self.verify = verify
self.headers = {
"User-Agent": "ara-http-client_%s" % CLIENT_VERSION,
@ -80,7 +80,7 @@ class AraHttpClient(object):
self.log = logging.getLogger(__name__)
self.endpoint = endpoint
self.auth = auth
self.timeout = timeout
self.timeout = int(timeout)
self.verify = verify
self.client = HttpClient(endpoint=self.endpoint, timeout=self.timeout, auth=self.auth, verify=self.verify)
active_client._instance = weakref.ref(self)