library/proxmox_qemu_agent.py: quick fix of invalid literal for float(): 6.3-3

This commit is contained in:
Evgeny Sinelnikov 2021-09-18 08:12:22 +04:00
parent 44068132fb
commit 90f50341b5

View File

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