From ac0388100259e6cfb054454658e78351bad6fa65 Mon Sep 17 00:00:00 2001 From: Yvan Watchman Date: Mon, 26 Jul 2021 06:33:01 +0200 Subject: [PATCH] Succesful clone from proxmox_kvm should return new vm id, not id from cloned vm. (#3034) * Clone sucess should return new vm id, not id from cloned vm. * add changelog fragment * Update changelogs/fragments/3034-promox-kvm-return-new-id.yaml Co-authored-by: Felix Fontein Co-authored-by: Yvan E. Watchman Co-authored-by: Felix Fontein --- changelogs/fragments/3034-promox-kvm-return-new-id.yaml | 3 +++ plugins/modules/cloud/misc/proxmox_kvm.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3034-promox-kvm-return-new-id.yaml diff --git a/changelogs/fragments/3034-promox-kvm-return-new-id.yaml b/changelogs/fragments/3034-promox-kvm-return-new-id.yaml new file mode 100644 index 0000000000..8cbd769a04 --- /dev/null +++ b/changelogs/fragments/3034-promox-kvm-return-new-id.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - proxmox_kvm - fix result of clone, now returns ``newid`` instead of ``vmid`` (https://github.com/ansible-collections/community.general/pull/3034). diff --git a/plugins/modules/cloud/misc/proxmox_kvm.py b/plugins/modules/cloud/misc/proxmox_kvm.py index 939c72a126..159968ce6e 100644 --- a/plugins/modules/cloud/misc/proxmox_kvm.py +++ b/plugins/modules/cloud/misc/proxmox_kvm.py @@ -1303,7 +1303,7 @@ def main(): if update: module.exit_json(changed=True, vmid=vmid, msg="VM %s with vmid %s updated" % (name, vmid)) elif clone is not None: - module.exit_json(changed=True, vmid=vmid, msg="VM %s with newid %s cloned from vm with vmid %s" % (name, newid, vmid)) + module.exit_json(changed=True, vmid=newid, msg="VM %s with newid %s cloned from vm with vmid %s" % (name, newid, vmid)) else: module.exit_json(changed=True, msg="VM %s with vmid %s deployed" % (name, vmid), **results) except Exception as e: