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

proxmox: Fix error on VM clone (#4278) (#4306)

* proxmox: Fix error on VM clone (#4278)

Incorrect parameters for `get_vmid()` and `get_vm()` caused failures when
cloning VMs.

Fixes #4278

* Update changelogs/fragments/4306-proxmox-fix-error-on-vm-clone.yml

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

Co-authored-by: Davíð Steinn Geirsson <david@isnic.is>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Davíð Steinn Geirsson 2022-03-07 06:45:19 +00:00 committed by GitHub
parent ea0697601b
commit c0f53d60c4
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 - fix error in check when creating or cloning (https://github.com/ansible-collections/community.general/pull/4306)."

View file

@ -1210,7 +1210,7 @@ def main():
module.exit_json(changed=False, vmid=existing_vmid, msg="VM with name <%s> already exists" % name)
# Ensure the choosen VM id doesn't already exist when cloning
if proxmox.get_vm(newid, ignore_errors=True):
if proxmox.get_vm(newid, ignore_missing=True):
module.exit_json(changed=False, vmid=vmid, msg="vmid %s with VM name %s already exists" % (newid, name))
if delete is not None: