[PR #10155/786be88f backport][stable-10] proxmox: fix: cannot access local variable 'identifier' where it is not associated with a value (#10156)

proxmox: fix: cannot access local variable 'identifier' where it is not associated with a value (#10155)

* fix: cannot access local variable 'identifier' where it is not associated with a value

* Add changelog fragment.

---------


(cherry picked from commit 786be88f43)

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Louis Jannett <louisjannett@icloud.com>
This commit is contained in:
patchback[bot] 2025-05-18 22:23:13 +02:00 committed by GitHub
parent 3856c184d2
commit 3b812e64ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- "proxmox - fix crash in module when the used on an existing LXC container with ``state=present`` and ``force=true`` (https://github.com/ansible-collections/community.proxmox/pull/91, https://github.com/ansible-collections/community.general/pull/10155)."

View file

@ -890,6 +890,7 @@ class ProxmoxLxcAnsible(ProxmoxAnsible):
self.module.exit_json(
changed=False, vmid=vmid, msg="VM %s already exists." % identifier
)
identifier = self.format_vm_identifier(vmid, lxc["name"])
self.module.debug(
"VM %s already exists, but we don't update and instead forcefully recreate it."
% identifier