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.

---------

Co-authored-by: Louis Jannett <louisjannett@icloud.com>
This commit is contained in:
Felix Fontein 2025-05-18 22:16:42 +02:00 committed by GitHub
parent 6008e6e1a7
commit 786be88f43
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