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

[PR #7464/03049893 backport][stable-8] fix vm removal in proxmox_pool_member.py (#7494)

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

(cherry picked from commit 0304989392)

Co-authored-by: aungvari <12872375+aungvari@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2023-11-06 20:45:46 +01:00 committed by GitHub
parent 71b1ae0aff
commit 5be75b8e43
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,
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:
self.proxmox_api.pools(poolid).put(vms=[vmid], delete=1)