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

Fix error when checking if Proxmox VM exists. (#4287)

* Fix error when checking if VM exists.

* Add changelog entry.

* Reword changelog entry.

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

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Markus Reiter 2022-03-04 07:31:24 +01:00 committed by GitHub
parent 9c3704bd00
commit 36ddb9b8e5
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 when checking whether Proxmox VM exists (https://github.com/ansible-collections/community.general/pull/4287).

View file

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