mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #7464/03049893 backport][stable-7] fix vm removal in proxmox_pool_member.py (#7493)
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:
parent
ebf8d9cde1
commit
40f87e25ff
2 changed files with 3 additions and 1 deletions
|
@ -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).
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue