diff --git a/netbox_agent/network.py b/netbox_agent/network.py index a3b0490..07ec6c0 100644 --- a/netbox_agent/network.py +++ b/netbox_agent/network.py @@ -147,6 +147,11 @@ class Network(): interface = nb.dcim.interfaces.get( mac_address=nic['mac'], ) + if not interface: + logging.info('Interface {} not found, creating..'.format( + mac_address=nic['mac']) + ) + interface = self.create_netbox_nic(device, nic) nic_update = False if nic['name'] != interface.name: