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 proxmoxer/backends/https.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ def __repr__(self):


class ProxmoxHTTPAuth(AuthBase):
def __init__(self, base_url, username, password, verify_ssl=False):
def __init__(self, base_url, username, password, verify_ssl=False, timeout=5):
response_data = requests.post(base_url + "/access/ticket",
verify=verify_ssl,
timeout=timeout,
data={"username": username, "password": password}).json()["data"]
if response_data is None:
raise AuthenticationError("Couldn't authenticate user: {0} to {1}".format(username, base_url + "/access/ticket"))
Expand Down Expand Up @@ -122,7 +123,7 @@ def __init__(self, host, user, password, port=8006, verify_ssl=True,
if auth_token is not None:
self.auth = ProxmoxHTTPTokenAuth(auth_token, csrf_token)
else:
self.auth = ProxmoxHTTPAuth(self.base_url, user, password, verify_ssl)
self.auth = ProxmoxHTTPAuth(self.base_url, user, password, verify_ssl, timeout)
self.verify_ssl = verify_ssl
self.mode = mode
self.timeout = timeout
Expand Down