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

[PR #6838/49349fce backport][stable-6] proxmox: default value when checking for dict key (#6885)

proxmox: default value when checking for dict key (#6838)

* proxmox: default value when checking for dict key

* add changelog frag

(cherry picked from commit 49349fce5e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2023-07-08 10:10:08 +02:00 committed by GitHub
parent d7494bb9e4
commit 7b71ffa1c4
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 - fix error when a configuration had no ``template`` field (https://github.com/ansible-collections/community.general/pull/6838, https://github.com/ansible-collections/community.general/issues/5372).

View file

@ -427,7 +427,7 @@ class ProxmoxLxcAnsible(ProxmoxAnsible):
"""Check if the specified container is a template."""
proxmox_node = self.proxmox_api.nodes(node)
config = getattr(proxmox_node, VZ_TYPE)(vmid).config.get()
return config['template']
return config.get('template', False)
def create_instance(self, vmid, node, disk, storage, cpus, memory, swap, timeout, clone, **kwargs):