From 2ed97602b4e117a5ede46ee874d804ecdf815904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20H=C3=B6sel?= Date: Sun, 26 Jun 2022 23:15:38 +0200 Subject: [PATCH] fix getattr() erroring out (#28) --- plugins/modules/proxmox_ha.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/modules/proxmox_ha.py b/plugins/modules/proxmox_ha.py index 1e05b0a..86bf602 100644 --- a/plugins/modules/proxmox_ha.py +++ b/plugins/modules/proxmox_ha.py @@ -194,7 +194,7 @@ def main(): # Remove the resource if not m.check_mode: try: - getattr(proxmox.cluster.ha.resources, vmid).delete() + getattr(proxmox.cluster.ha.resources, str(vmid)).delete() except proxmoxer.ResourceException as e: m.fail_json(msg=f"Could not remove HA resource {m.params['vmid']}. Exception: {e}") m.exit_json(changed=True, msg=f"Resource {vmid} removed") @@ -240,7 +240,7 @@ def main(): _t = desired_config _t.pop("sid") try: - getattr(proxmox.cluster.ha.resources, vmid).put(**_t) + getattr(proxmox.cluster.ha.resources, str(vmid)).put(**_t) except proxmoxer.ResourceException as e: m.fail_json( msg=f"Could not change HA resource {vmid}. Exception: {e}")