diff --git a/data/routers.json b/data/routers.json index 9827efdb27d98eb913578b38616ef719b38ced8d..8c648b5763c91c577065b07a6b3d880376bb0279 100644 --- a/data/routers.json +++ b/data/routers.json @@ -8,7 +8,8 @@ "router_role": "p", "router_lo_ipv4_address": "62.40.119.2", "router_lo_ipv6_address": "2001:798:1ab::2", - "router_lo_iso_address": "49.51e5.0001.0620.4011.9002.00" + "router_lo_iso_address": "49.51e5.0001.0620.4011.9002.00", + "is_ias_connected": false }, { "customer": "GÉANT", @@ -19,6 +20,7 @@ "router_role": "p", "router_lo_ipv4_address": "62.40.119.1", "router_lo_ipv6_address": "2001:798:1ab::1", - "router_lo_iso_address": "49.51e5.0001.0620.4011.9001.00" + "router_lo_iso_address": "49.51e5.0001.0620.4011.9001.00", + "is_ias_connected": false } ] diff --git a/gso/cli/imports.py b/gso/cli/imports.py index 2adfac2a391d55173ab7318dc2c6686ed8872baa..07389ea34372a39eba09f818053e1aa47a9843ae 100644 --- a/gso/cli/imports.py +++ b/gso/cli/imports.py @@ -76,14 +76,14 @@ def generic_import_data( @app.command() -def import_sites(filepath: str) -> None: +def import_sites(filepath: str = common_filepath_option) -> None: """Import sites into GSO.""" # Use the import_data function to handle common import logic generic_import_data(filepath, SiteImportModel, import_site, "site_name") @app.command() -def import_routers(filepath: str) -> None: +def import_routers(filepath: str = common_filepath_option) -> None: """Import routers into GSO.""" # Use the import_data function to handle common import logic generic_import_data(filepath, RouterImportModel, import_router, "hostname") @@ -101,7 +101,7 @@ def get_router_subscription_id(node_name: str) -> str | None: @app.command() -def import_iptrunks(filepath: str) -> None: +def import_iptrunks(filepath: str = common_filepath_option) -> None: """Import IP trunks into GSO.""" successfully_imported_data = [] data = read_data(filepath) diff --git a/gso/services/netbox_client.py b/gso/services/netbox_client.py index 4bf9fd6609c0032b2fc30c6605b5dd87ca62190d..bae9485e67c7bceb8a7130776020db93c62bf46c 100644 --- a/gso/services/netbox_client.py +++ b/gso/services/netbox_client.py @@ -125,7 +125,9 @@ class NetboxClient: def delete_interface(self, device_name: str, iface_name: str) -> None: """Delete an interface from a device by name.""" interface = self.get_interface_by_name_and_device(iface_name, device_name) - return interface.delete() + if interface: + return interface.delete() + return None def create_device_type(self, manufacturer: str, model: str, slug: str) -> DeviceTypes: """Create a new device type in Netbox."""