Open
Description
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()