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

Fix Proxmox node, name condition. (#5108)

* Fix Proxmox `node`, `name` condition.

* Add changelog entry.
This commit is contained in:
Markus Reiter 2022-08-12 04:03:57 +02:00 committed by GitHub
parent dc17044149
commit 0338eb7a7c
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 wrong condition (https://github.com/ansible-collections/community.general/pull/5108).

View file

@ -1234,7 +1234,7 @@ def main():
module.exit_json(changed=False, vmid=vmid, msg="VM with vmid <%s> already exists" % vmid) module.exit_json(changed=False, vmid=vmid, msg="VM with vmid <%s> already exists" % vmid)
elif proxmox.get_vmid(name, ignore_missing=True) and not (update or clone): elif proxmox.get_vmid(name, ignore_missing=True) and not (update or clone):
module.exit_json(changed=False, vmid=proxmox.get_vmid(name), msg="VM with name <%s> already exists" % name) module.exit_json(changed=False, vmid=proxmox.get_vmid(name), msg="VM with name <%s> already exists" % name)
elif not (node, name): elif (not node) or (not name):
module.fail_json(msg='node, name is mandatory for creating/updating vm') module.fail_json(msg='node, name is mandatory for creating/updating vm')
elif not proxmox.get_node(node): elif not proxmox.get_node(node):
module.fail_json(msg="node '%s' does not exist in cluster" % node) module.fail_json(msg="node '%s' does not exist in cluster" % node)