From 838ffd8e410b05cd3dba9a94fefc6a63a794ebbf Mon Sep 17 00:00:00 2001 From: ChrNic Date: Thu, 21 Jul 2022 08:32:24 +0200 Subject: [PATCH] using dynamic ref to NIC --- 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 fb97409..500dc95 100644 --- a/netbox_agent/network.py +++ b/netbox_agent/network.py @@ -214,7 +214,7 @@ class Network(object): lldp_vlan = self.lldp.get_switch_vlan(nic['name']) if config.network.lldp else None # For strange reason, we need to get the object from scratch # The object returned by pynetbox's save isn't always working (since pynetbox 6) - interface = nb.dcim.interfaces.get(id=interface.id) + interface = self.nb_net.interfaces.get(id=interface.id) # Handle the case were the local interface isn't an interface vlan as reported by Netbox # and that LLDP doesn't report a vlan-id