diff --git a/netbox_agent/network.py b/netbox_agent/network.py index a303a83f..ab53dc30 100644 --- a/netbox_agent/network.py +++ b/netbox_agent/network.py @@ -247,7 +247,7 @@ def reset_vlan_on_interface(self, nic, interface): interface.untagged_vlan = None # Finally if LLDP reports a vlan-id with the pvid attribute elif lldp_vlan: - pvid_vlan = [key for (key, value) in lldp_vlan.items() if value['pvid']] + pvid_vlan = [key for (key, value) in lldp_vlan.items() if 'pvid' in value and value['pvid']] if len(pvid_vlan) > 0 and ( interface.mode is None or interface.mode.value != self.dcim_choices['interface:mode']['Access'] or