Skip to content

Commit

Permalink
Send string instead of boolean to proxmox api (#5198)
Browse files Browse the repository at this point in the history
* Send string instead of boolean to proxmox api

* Add changelog fragment.

* Update plugins/modules/cloud/misc/proxmox_kvm.py

Co-authored-by: castorsky <csky57@gmail.com>

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: castorsky <csky57@gmail.com>
  • Loading branch information
3 people committed Oct 23, 2022
1 parent 2680739 commit b9d0864
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/5198-proxmox.yml
@@ -0,0 +1,2 @@
bugfixes:
- "proxmox_kvm - fix ``agent`` parameter when boolean value is specified (https://github.com/ansible-collections/community.general/pull/5198)."
2 changes: 1 addition & 1 deletion plugins/modules/cloud/misc/proxmox_kvm.py
Expand Up @@ -963,7 +963,7 @@ def create_vm(self, vmid, newid, node, name, memory, cpu, cores, sockets, update
if 'agent' in kwargs:
try:
# The API also allows booleans instead of e.g. `enabled=1` for backward-compatibility.
kwargs['agent'] = boolean(kwargs['agent'], strict=True)
kwargs['agent'] = int(boolean(kwargs['agent'], strict=True))
except TypeError:
# Not something that Ansible would parse as a boolean.
pass
Expand Down

0 comments on commit b9d0864

Please sign in to comment.