Skip to content

Commit

Permalink
fix getattr() erroring out (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhoesel authored Jun 26, 2022
1 parent 9387b4b commit 2ed9760
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/modules/proxmox_ha.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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}")
Expand Down

0 comments on commit 2ed9760

Please sign in to comment.