still cache
This commit is contained in:
parent
27b2efbc95
commit
a83aa9dd3e
|
|
@ -39,6 +39,8 @@ class PVEApi(object):
|
||||||
"""
|
"""
|
||||||
self.host = host
|
self.host = host
|
||||||
self.url = "https://" + self.host + "/api2/json"
|
self.url = "https://" + self.host + "/api2/json"
|
||||||
|
self.username = username
|
||||||
|
self.password = password
|
||||||
if self.check_cacheexpire():
|
if self.check_cacheexpire():
|
||||||
self.csrftoken = get_auth(self.host, username, password)[0]
|
self.csrftoken = get_auth(self.host, username, password)[0]
|
||||||
self.ticket = get_auth(self.host, username, password)[1]
|
self.ticket = get_auth(self.host, username, password)[1]
|
||||||
|
|
@ -59,8 +61,8 @@ class PVEApi(object):
|
||||||
timestamp = data['timestamp']
|
timestamp = data['timestamp']
|
||||||
return True if time.time() - timestamp > 3600 else False
|
return True if time.time() - timestamp > 3600 else False
|
||||||
except:
|
except:
|
||||||
self.csrftoken = get_auth(self.host, username, password)[0]
|
self.csrftoken = get_auth(self.host, self.username, self.password)[0]
|
||||||
self.ticket = get_auth(self.host, username, password)[1]
|
self.ticket = get_auth(self.host, self.username, self.password)[1]
|
||||||
self.write_ticketcache()
|
self.write_ticketcache()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue