From 294619feea19ec1c3c6b63771b9df30809bb621e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Teod=C3=B3sio?= Date: Mon, 18 Nov 2024 20:39:18 +0100 Subject: [PATCH] Handle missing pvid in LLDP VLAN data --- netbox_agent/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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