Set transport options on requests session

This commit is contained in:
Tadeáš Ursíny
2018-05-09 13:13:01 +02:00
committed by Davanum Srinivas
parent 11cf6c43f1
commit 90b7a19cdc

View File

@@ -51,12 +51,14 @@ class Etcd3Client(object):
self.host = host self.host = host
self.port = port self.port = port
self.protocol = protocol self.protocol = protocol
self.session = requests.Session() self.session = requests.Session()
self.kwargs = { if timeout is not None:
"timeout": timeout, self.session.timeout = timeout
"verify": ca_cert, if ca_cert is not None:
"cert": (cert_cert, cert_key) self.session.verify = ca_cert
} if cert_cert is not None and cert_key is not None:
self.session.cert = (cert_cert, cert_key)
def get_url(self, path): def get_url(self, path):
"""Construct a full url to the v3alpha API given a specific path """Construct a full url to the v3alpha API given a specific path