From 60167e892e85dd8879a4f57c8f76515917975765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Solbj=C3=B8rg?= Date: Sun, 2 Apr 2023 12:23:45 +0200 Subject: fix(netbox2gondul): Skip importing invalid configured devices --- tools/netbox/scripts/netbox2gondul/netbox2gondul.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/netbox/scripts/netbox2gondul/netbox2gondul.py') diff --git a/tools/netbox/scripts/netbox2gondul/netbox2gondul.py b/tools/netbox/scripts/netbox2gondul/netbox2gondul.py index 0613350..400e257 100644 --- a/tools/netbox/scripts/netbox2gondul/netbox2gondul.py +++ b/tools/netbox/scripts/netbox2gondul/netbox2gondul.py @@ -205,8 +205,8 @@ class Netbox2Gondul(Script): # sanity check for device in input_devices: if not device.primary_ip4 and not device.primary_ip6: - self.log_failure(f'Device {device.name} is missing primary IPv4 and IPv6 address.') - return + self.log_warning(f'Device {device.name} is missing primary IPv4 and IPv6 address, skipping...') + continue vlan: VLAN = None prefix_v4: Prefix = None @@ -224,8 +224,8 @@ class Netbox2Gondul(Script): self.log_warning(f'Device {device.name} is missing primary IPv6 address.') if prefix_v4 is not None and prefix_v6 is not None and prefix_v4.vlan != prefix_v6.vlan: - self.log_failure(f'VLANs differ for the IPv4 and IPv6 addresses.') - return + self.log_warning(f'VLANs differ for the IPv4 and IPv6 addresses, skipping...') + continue networks.append(self.network_to_gondul_format(vlan, prefix_v4, prefix_v6)) -- cgit v1.2.3