8000 unmanaged interface group facts when removing pfsense_interface · Issue #182 · pfsensible/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

unmanaged interface group facts when removing pfsense_interface #182

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

Open
atriviality opened this issue May 21, 2025 · 0 comments
Open

unmanaged interface group facts when removing pfsense_interface #182

atriviality opened this issue May 21, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@atriviality
Copy link
atriviality commented May 21, 2025

When removing a pfsense_interface, the lines of code below remove the interface from its groups before removing the interface altogether; because there can be unmanaged facts for existing interface groups, the call to ifgroup_elt.find('members').text can yield None. This causes an error when the split function is invoked.

Problematic code: https://github.com/pfsensible/core/blob/master/plugins/module_utils/interface.py#L330-L332

        if self.pfsense.ifgroups is not None:
            for ifgroup_elt in self.pfsense.ifgroups.findall("ifgroupentry"):
                members = ifgroup_elt.find('members').text.split()

A null check should prevent this:

        if self.pfsense.ifgroups is not None:
            for ifgroup_elt in self.pfsense.ifgroups.findall("ifgroupentry"):
                if not ifgroup_elt.find('members').text:
                       continue
                members = ifgroup_elt.find('members').text.split()
@atriviality atriviality added the bug Something isn't working label May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant
0