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:
parent
9c3704bd00
commit
36ddb9b8e5
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/4287-fix-proxmox-vm-chek.yml
Normal file
2
changelogs/fragments/4287-fix-proxmox-vm-chek.yml
Normal 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).
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue