From a83aa9dd3eff7bb7798e23dba86b11af1d2eef96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mi=C5=82osz=20Stocki?= Date: Thu, 12 Dec 2019 14:30:04 +0100 Subject: [PATCH] still cache --- PVEApi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PVEApi.py b/PVEApi.py index 6867bd0..010a24d 100755 --- a/PVEApi.py +++ b/PVEApi.py @@ -39,6 +39,8 @@ class PVEApi(object): """ self.host = host self.url = "https://" + self.host + "/api2/json" + self.username = username + self.password = password if self.check_cacheexpire(): self.csrftoken = get_auth(self.host, username, password)[0] self.ticket = get_auth(self.host, username, password)[1] @@ -59,8 +61,8 @@ class PVEApi(object): timestamp = data['timestamp'] return True if time.time() - timestamp > 3600 else False except: - self.csrftoken = get_auth(self.host, username, password)[0] - self.ticket = get_auth(self.host, username, password)[1] + self.csrftoken = get_auth(self.host, self.username, self.password)[0] + self.ticket = get_auth(self.host, self.username, self.password)[1] self.write_ticketcache()