From ba77d56258737966cc98e9608bb233a57cc47e80 Mon Sep 17 00:00:00 2001 From: Xabi Ezpeleta Date: Fri, 15 Mar 2019 09:39:49 +0100 Subject: [PATCH] Add a trailing slash to the proxmox url (fixes #15) --- proxmox.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/proxmox.py b/proxmox.py index e030f11..9cd41e0 100755 --- a/proxmox.py +++ b/proxmox.py @@ -127,6 +127,10 @@ class ProxmoxAPI(object): elif not options.password: raise Exception( 'Missing mandatory parameter --password (or PROXMOX_PASSWORD or "password" key in config file).') + + # URL should end with a trailing slash + if not options.url.endswith("/"): + options.url = options.url + "/" def auth(self): request_path = '{0}api2/json/access/ticket'.format(self.options.url)