still cache
This commit is contained in:
parent
27b2efbc95
commit
a83aa9dd3e
|
|
@ -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()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue