From bc83586c1541eabd44fc80f0d2eb86c2f0aee987 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 13 Nov 2022 21:23:50 +0100 Subject: [PATCH] [PR #5493/27a4ffc2 backport][stable-5] Fix: Duplicate vmid in proxmox_disk module #5492 (#5536) * Fix: Duplicate vmid in proxmox_disk module #5492 (#5493) https://github.com/ansible-collections/community.general/issues/5492 (cherry picked from commit 27a4ffc2931e5ccdd3a2d4d09260351d1050c4f9) * Add changelog fragment. (cherry picked from commit 672385309ce68912201ed1bd34bf74bc0cd25112) Co-authored-by: Doc_Tiebeau Co-authored-by: Felix Fontein --- changelogs/fragments/5493-proxmox.yml | 2 ++ plugins/modules/cloud/misc/proxmox_disk.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/5493-proxmox.yml diff --git a/changelogs/fragments/5493-proxmox.yml b/changelogs/fragments/5493-proxmox.yml new file mode 100644 index 0000000000..a14b7767e6 --- /dev/null +++ b/changelogs/fragments/5493-proxmox.yml @@ -0,0 +1,2 @@ +bugfixes: + - "proxmox_disk - avoid duplicate ``vmid`` reference (https://github.com/ansible-collections/community.general/issues/5492, https://github.com/ansible-collections/community.general/pull/5493)." diff --git a/plugins/modules/cloud/misc/proxmox_disk.py b/plugins/modules/cloud/misc/proxmox_disk.py index 7a39d38d05..8f55e2d130 100644 --- a/plugins/modules/cloud/misc/proxmox_disk.py +++ b/plugins/modules/cloud/misc/proxmox_disk.py @@ -725,7 +725,7 @@ def main(): actual_size = disk_config['size'] if size == actual_size: module.exit_json(changed=False, vmid=vmid, msg="Disk %s is already %s size" % (disk, size)) - proxmox.proxmox_api.nodes(vm['node']).qemu(vmid).resize.set(vmid=vmid, disk=disk, size=size) + proxmox.proxmox_api.nodes(vm['node']).qemu(vmid).resize.set(disk=disk, size=size) module.exit_json(changed=True, vmid=vmid, msg="Disk %s resized in VM %s" % (disk, vmid)) except Exception as e: module.fail_json(msg="Failed to resize disk %s in VM %s with exception: %s" % (disk, vmid, str(e)))