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) (#4313)

* 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>
(cherry picked from commit 36ddb9b8e5)

Co-authored-by: Markus Reiter <me@reitermark.us>
This commit is contained in:
patchback[bot] 2022-03-04 13:30:57 +01:00 committed by GitHub
parent d7b31655c4
commit a56879c1b0
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)