Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

Commit

Permalink
Set transport options on requests session
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatIsGeek authored and dims committed May 9, 2018
1 parent 11cf6c4 commit 90b7a19
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions etcd3gw/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ def __init__(self, host='localhost', port=2379, protocol="http",
self.host = host
self.port = port
self.protocol = protocol

self.session = requests.Session()
self.kwargs = {
"timeout": timeout,
"verify": ca_cert,
"cert": (cert_cert, cert_key)
}
if timeout is not None:
self.session.timeout = timeout
if ca_cert is not None:
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):
"""Construct a full url to the v3alpha API given a specific path
Expand Down

0 comments on commit 90b7a19

Please sign in to comment.