From 90f50341b52570e3877b1e86052c179d289e07a8 Mon Sep 17 00:00:00 2001 From: Evgeny Sinelnikov Date: Sat, 18 Sep 2021 08:12:22 +0400 Subject: [PATCH] library/proxmox_qemu_agent.py: quick fix of invalid literal for float(): 6.3-3 --- library/proxmox_qemu_agent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/proxmox_qemu_agent.py b/library/proxmox_qemu_agent.py index 76efc91..210a9f9 100644 --- a/library/proxmox_qemu_agent.py +++ b/library/proxmox_qemu_agent.py @@ -135,7 +135,8 @@ def main(): proxmox = ProxmoxAPI(api_host, user=api_user, password=api_password, verify_ssl=validate_certs) global VZ_TYPE global PVE_MAJOR_VERSION - PVE_MAJOR_VERSION = 3 if float(proxmox.version.get()['version']) < 4.0 else 4 + pve_version = re.sub(r'-\d$', '', proxmox.version.get()['version']) + PVE_MAJOR_VERSION = 3 if float(pve_version) < 4.0 else int(pve_version.split('.')[0]) except Exception as e: module.fail_json(msg='authorization on proxmox cluster failed with exception: %s' % e)