1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fix vm removal in proxmox_pool_member.py (#7464)

* fix vm removal in proxmox_pool_member.py

in the original the vm doesn't get removed, always errors with "'Failed to delete a member (12345) from the pool TestPool: list.remove(x): x not in list'

* add changelog fragment

* fix linting errors in changelog
This commit is contained in:
aungvari 2023-11-06 20:01:05 +01:00 committed by GitHub
parent ab0b85d7d2
commit 0304989392
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- proxmox_pool_member - absent state for type VM did not delete VMs from the pools (https://github.com/ansible-collections/community.general/pull/7464).

View file

@ -192,7 +192,7 @@ class ProxmoxPoolMemberAnsible(ProxmoxAnsible):
self.module.exit_json(changed=False, poolid=poolid, member=member, self.module.exit_json(changed=False, poolid=poolid, member=member,
diff=diff, msg="VM {0} is not part of the pool {1}".format(member, poolid)) diff=diff, msg="VM {0} is not part of the pool {1}".format(member, poolid))
all_members_after.remove(member) all_members_after.remove(vmid)
if not self.module.check_mode: if not self.module.check_mode:
self.proxmox_api.pools(poolid).put(vms=[vmid], delete=1) self.proxmox_api.pools(poolid).put(vms=[vmid], delete=1)