-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: cannot access local variable 'identifier' where it is not associ… #10030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ated with a value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Can you please add a changelog fragment? Thanks!
@@ -890,6 +890,7 @@ def lxc_present(self, vmid, hostname, node, update, force): | |||
self.module.exit_json( | |||
changed=False, vmid=vmid, msg="VM %s already exists." % identifier | |||
) | |||
identifier = self.format_vm_identifier(vmid, lxc["name"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only path where it isn't defined is in else
of the above if
s:
identifier = self.format_vm_identifier(vmid, lxc["name"]) | |
else: | |
identifier = self.format_vm_identifier(vmid, lxc["name"]) |
FYI, the proxmox content from this repository is currently being moved to https://github.com/ansible-collections/community.proxmox. Once that repo is ready, you'll have to create a new PR there, as from that point this repo is only accepting bugfixes that have already been merged into the other repo. For now you can use this PR in this repo to continue working on the PR. (The other repo has no CI yet, for example.) |
SUMMARY
If
community.general.proxmox
is called on an existing lxc container withstate=present
andforce: true
then we take a code path in which a debugging message is printed but the identifier was no defined beforehand, leading to the error "An error occurred: cannot access local variable 'identifier' where it is not associated with a value".ISSUE TYPE
COMPONENT NAME
proxmox