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

[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 27a4ffc293)

* Add changelog fragment.

(cherry picked from commit 672385309c)

Co-authored-by: Doc_Tiebeau <elie.saintfelix@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2022-11-13 21:23:50 +01:00 committed by GitHub
parent b765938b79
commit bc83586c15
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_disk - avoid duplicate ``vmid`` reference (https://github.com/ansible-collections/community.general/issues/5492, https://github.com/ansible-collections/community.general/pull/5493)."

View file

@ -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)))