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()