Skip to content

Commit

Permalink
ensure ticket for get vm id (closes #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt c committed Sep 27, 2024
1 parent f70f94e commit 07b3308
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pveautomate/automate.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def get_next_vm_id(self, ticket=None):
int: The next available VMID.
"""
next_id_url = f"{self.proxmox_url}/cluster/nextid"
ticket, _ = self.authenticate()
if not ticket:
ticket, _ = self.authenticate()
headers = {"Cookie": f"PVEAuthCookie={ticket}"}
response = requests.get(next_id_url, headers=headers, verify=self.verify_ssl)
response.raise_for_status()
Expand Down

0 comments on commit 07b3308

Please sign in to comment.