Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions quantastor/qs_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ class QuantastorClient(object):
_username = ""
_password = ""
_cert = ""
def __init__(self, hostname="", username="", password="", cert=""):
def __init__(self, hostname="", username="", password="", cert="", timeout=None):
self._hostname = hostname
self._username = username
self._password = password
self._cert = cert
self._timeout = timeout


if environ.get('QS_HOSTNAME') and hostname == "":
Expand Down Expand Up @@ -53,7 +54,7 @@ def make_call(self, api, payload):
if not path.exists(self._cert) or not self._cert:
print ("Warning - SSL certificate path: '" + str(self._cert) + "' either doesn't exist, or was not given. HTTPS request cannot be verified.")
certPath = False
r = requests.get(strURL, params=payload, verify=certPath, auth=self._auth)
r = requests.get(strURL, params=payload, verify=certPath, auth=self._auth, timeout=self._timeout)
if r.status_code != 200:
raise Exception("Failed to make a request '" + api + "' payload '" + str(payload) + "' status code = " + str(r.status_code) + "strUrl " + strURL)
jsonOutput = r.json()
Expand Down