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:
parent
d7494bb9e4
commit
7b71ffa1c4
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/6838-proxmox-dict-template.yml
Normal file
2
changelogs/fragments/6838-proxmox-dict-template.yml
Normal 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).
|
|
@ -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):
|
||||
|
||||
|
|
Loading…
Reference in a new issue