From 8c8d4b578aa08bc073bd1a47480b03efc591bbc2 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 25 Feb 2021 13:07:44 +0100 Subject: [PATCH] proxmox_kvm: trivial patch for github issue #1875 (#1895) (#1898) * proxmox_kvm: trivial patch for Github issue #1875 * proxmox_kvm: add a changelog fragment * Update changelogs/fragments/1895-proxmox-kvm-fix-issue-1875.yml Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein (cherry picked from commit bb7ce740fe97e4aae8907a94c5a5e9d25f53bc13) Co-authored-by: Tristan Le Guern --- changelogs/fragments/1895-proxmox-kvm-fix-issue-1875.yml | 3 +++ plugins/modules/cloud/misc/proxmox_kvm.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/1895-proxmox-kvm-fix-issue-1875.yml diff --git a/changelogs/fragments/1895-proxmox-kvm-fix-issue-1875.yml b/changelogs/fragments/1895-proxmox-kvm-fix-issue-1875.yml new file mode 100644 index 0000000000..73d908cfa8 --- /dev/null +++ b/changelogs/fragments/1895-proxmox-kvm-fix-issue-1875.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - proxmox_kvm - fix parameter ``vmid`` passed twice to ``exit_json`` while creating a virtual machine without cloning (https://github.com/ansible-collections/community.general/issues/1875, https://github.com/ansible-collections/community.general/pull/1895). diff --git a/plugins/modules/cloud/misc/proxmox_kvm.py b/plugins/modules/cloud/misc/proxmox_kvm.py index f63f8faec9..f5b280f7ca 100644 --- a/plugins/modules/cloud/misc/proxmox_kvm.py +++ b/plugins/modules/cloud/misc/proxmox_kvm.py @@ -1331,7 +1331,7 @@ def main(): 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)) else: - module.exit_json(changed=True, vmid=vmid, msg="VM %s with vmid %s deployed" % (name, vmid), **results) + module.exit_json(changed=True, msg="VM %s with vmid %s deployed" % (name, vmid), **results) except Exception as e: if update: module.fail_json(vmid=vmid, msg="Unable to update vm {0} with vmid {1}=".format(name, vmid) + str(e))