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

[PR #6827/216962a9 backport][stable-7] proxmox_kvm: Add required timeout arg when force deleting (#6866)

proxmox_kvm: Add required timeout arg when force deleting (#6827)

* Add required timeout arg when force deleting

* Add changelog fragment

* Update changelogs/fragments/6827-proxmox_kvm-force-delete-bug-fix.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 216962a98c)

Co-authored-by: Drew Brown <drew@drewburr.com>
This commit is contained in:
patchback[bot] 2023-07-06 21:38:51 +02:00 committed by GitHub
parent c1536a3501
commit abd2a85709
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_kvm - ``absent`` state with ``force`` specified failed to stop the VM due to the ``timeout`` value not being passed to ``stop_vm`` (https://github.com/ansible-collections/community.general/pull/6827).

View file

@ -1503,7 +1503,7 @@ def main():
status['status'] = vm['status'] status['status'] = vm['status']
if vm['status'] == 'running': if vm['status'] == 'running':
if module.params['force']: if module.params['force']:
proxmox.stop_vm(vm, True) proxmox.stop_vm(vm, True, timeout=module.params['timeout'])
else: else:
module.exit_json(changed=False, vmid=vmid, msg="VM %s is running. Stop it before deletion or use force=true." % vmid) module.exit_json(changed=False, vmid=vmid, msg="VM %s is running. Stop it before deletion or use force=true." % vmid)
taskid = proxmox_node.qemu.delete(vmid) taskid = proxmox_node.qemu.delete(vmid)