[PR #9809/e39320c3 backport][stable-10] proxmox: fix status getter (#9817)

proxmox: fix status getter (#9809)

* proxmox: fix status getter

get_lxc_status was missing a selection of the 'status' key

* proxmox: add changelog fragment

* proxmox: fix changelog fragment

(cherry picked from commit e39320c354)

Co-authored-by: JL Euler <Lithimlin@users.noreply.github.com>
stable-10
patchback[bot] 2025-03-01 11:30:52 +01:00 committed by GitHub
parent 91d515bd1e
commit 195ac4d7e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1,2 @@
bugfixes:
- proxmox - add missing key selection of ``'status'`` key to ``get_lxc_status`` (https://github.com/ansible-collections/community.general/issues/9696, https://github.com/ansible-collections/community.general/pull/9809).

View File

@ -1655,7 +1655,7 @@ class ProxmoxLxcAnsible(ProxmoxAnsible):
proxmox_node = self.proxmox_api.nodes(node_name)
except Exception as e:
self.module.fail_json(msg="Unable to retrieve node information: %s" % e)
return getattr(proxmox_node, self.VZ_TYPE)(vmid).status.current.get()
return getattr(proxmox_node, self.VZ_TYPE)(vmid).status.current.get()['status']
def format_vm_identifier(self, vmid, hostname):
if vmid and hostname: