From 61a7490762387749209c33245ddb6943ea992bf2 Mon Sep 17 00:00:00 2001 From: cpj <122913951+craigcpj@users.noreply.github.com> Date: Wed, 22 Feb 2023 14:42:22 -0600 Subject: [PATCH 1/7] Add in the work around for now --- network_importer/adapters/nautobot_api/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/network_importer/adapters/nautobot_api/models.py b/network_importer/adapters/nautobot_api/models.py index 068dd3d..d6f793d 100644 --- a/network_importer/adapters/nautobot_api/models.py +++ b/network_importer/adapters/nautobot_api/models.py @@ -123,6 +123,10 @@ def convert_vlan_list_to_nids(vlan_uids): nb_params["mode"] = "access" elif "switchport_mode" in attrs and attrs["switchport_mode"] == "TRUNK": nb_params["mode"] = "tagged" + elif ("switchport_mode" in attrs and attrs["switchport_mode"] == "NONE") and attrs["mode"] == "L3_SUB_VLAN": + LOGGER.warning("NB_PARAMS: %s", nb_params) + LOGGER.warning("ATTRS: %s", attrs) + nb_params["mode"] = "tagged" # if is None: # intf_properties["enabled"] = intf.active From 3749255ba1dbe0c231ed34089778b422fbd4b542 Mon Sep 17 00:00:00 2001 From: cpj <122913951+craigcpj@users.noreply.github.com> Date: Wed, 22 Feb 2023 14:43:26 -0600 Subject: [PATCH 2/7] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 017edd5..0ae70f1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +To use this local branch: +git clone this repo +pip install network-importer/ + # Network Importer The network importer is a tool/library to analyze and/or synchronize an existing network with a Network Source of Truth (SOT), it's designed to be idempotent and by default it's only showing the difference between the running network and the remote SOT. From 63a25cef7efaaaf651f5d7aa5f993ef18d19d592 Mon Sep 17 00:00:00 2001 From: cpj <122913951+craigcpj@users.noreply.github.com> Date: Wed, 22 Feb 2023 14:43:52 -0600 Subject: [PATCH 3/7] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ae70f1..5a77150 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ To use this local branch: +``` git clone this repo -pip install network-importer/ +pip install network-importer/ +``` # Network Importer The network importer is a tool/library to analyze and/or synchronize an existing network with a Network Source of Truth (SOT), it's designed to be idempotent and by default it's only showing the difference between the running network and the remote SOT. From 3014ccfddf4146d5210195a6b5b43e71161a1b4e Mon Sep 17 00:00:00 2001 From: cpj <122913951+craigcpj@users.noreply.github.com> Date: Wed, 22 Feb 2023 14:44:29 -0600 Subject: [PATCH 4/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5a77150..8f8946a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ To use this local branch: ``` -git clone this repo +git clone git@github.com:craigcpj/network-importer.git pip install network-importer/ ``` From a5f220addfae24a61747c53597c85333badd2706 Mon Sep 17 00:00:00 2001 From: cpj <122913951+craigcpj@users.noreply.github.com> Date: Wed, 22 Feb 2023 14:50:16 -0600 Subject: [PATCH 5/7] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 8f8946a..0b226b4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ To use this local branch: ``` -git clone git@github.com:craigcpj/network-importer.git - +git clone https://github.com/craigcpj/network-importer.git pip install network-importer/ ``` # Network Importer From 87a20b7b6b0948af3c55c307fafa2046d1ba1795 Mon Sep 17 00:00:00 2001 From: cpj <122913951+craigcpj@users.noreply.github.com> Date: Wed, 22 Feb 2023 17:21:02 -0600 Subject: [PATCH 6/7] change warning to info --- network_importer/adapters/nautobot_api/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network_importer/adapters/nautobot_api/models.py b/network_importer/adapters/nautobot_api/models.py index d6f793d..6d36290 100644 --- a/network_importer/adapters/nautobot_api/models.py +++ b/network_importer/adapters/nautobot_api/models.py @@ -124,8 +124,8 @@ def convert_vlan_list_to_nids(vlan_uids): elif "switchport_mode" in attrs and attrs["switchport_mode"] == "TRUNK": nb_params["mode"] = "tagged" elif ("switchport_mode" in attrs and attrs["switchport_mode"] == "NONE") and attrs["mode"] == "L3_SUB_VLAN": - LOGGER.warning("NB_PARAMS: %s", nb_params) - LOGGER.warning("ATTRS: %s", attrs) + LOGGER.info("NB_PARAMS: %s", nb_params) + LOGGER.info("ATTRS: %s", attrs) nb_params["mode"] = "tagged" # if is None: From 4eadd66dd7222fbfe6b919f21f794554d8fd093a Mon Sep 17 00:00:00 2001 From: cpj <122913951+craigcpj@users.noreply.github.com> Date: Mon, 13 Mar 2023 15:59:17 -0500 Subject: [PATCH 7/7] Add some debugging --- network_importer/adapters/nautobot_api/models.py | 3 ++- network_importer/adapters/network_importer/adapter.py | 3 +++ network_importer/inventory.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/network_importer/adapters/nautobot_api/models.py b/network_importer/adapters/nautobot_api/models.py index 6d36290..370840d 100644 --- a/network_importer/adapters/nautobot_api/models.py +++ b/network_importer/adapters/nautobot_api/models.py @@ -655,11 +655,12 @@ def create(cls, diffsync: "DiffSync", ids: dict, attrs: dict) -> Optional["DiffS ) if not interface_a: LOGGER.info( - "Unable to create Cable %s in %s, unable to find the interface %s %s", + "CABLE: Unable to create Cable %s in %s, unable to find the interface %s %s %s", item.get_unique_id(), diffsync.name, ids["device_a_name"], ids["interface_a_name"], + item, ) return item diff --git a/network_importer/adapters/network_importer/adapter.py b/network_importer/adapters/network_importer/adapter.py index 7e89607..ab782cf 100644 --- a/network_importer/adapters/network_importer/adapter.py +++ b/network_importer/adapters/network_importer/adapter.py @@ -18,6 +18,7 @@ from network_importer.inventory import reachable_devs, valid_and_reachable_devs from network_importer.tasks import check_if_reachable, warning_not_reachable from network_importer.drivers import dispatcher +from nornir_napalm.plugins.tasks import napalm_get from network_importer.processors.get_neighbors import GetNeighbors, hosts_for_cabling from network_importer.processors.get_vlans import GetVlans from network_importer.utils import ( @@ -404,9 +405,11 @@ def load_batfish_cable(self): for link in p2p_links.frame().itertuples(): if link.Interface.hostname not in device_names: + LOGGER.debug("A SIDE DEVICE NOT IN: %s / %s", link.Interface.hostname, device_names) continue if link.Remote_Interface.hostname not in device_names: + LOGGER.debug("Z SIDE DEVICE NOT IN: %s / %s", link.Remote_Interface.hostname, device_names) continue cable = self.cable( diff --git a/network_importer/inventory.py b/network_importer/inventory.py index 7be37aa..e76929b 100644 --- a/network_importer/inventory.py +++ b/network_importer/inventory.py @@ -13,7 +13,7 @@ class NetworkImporterHost(Host): site_name: Optional[str] """Name of the site this device belong to.""" - is_reacheable: Optional[bool] + is_reachable: Optional[bool] = "" """Global Flag to indicate if we are able to connect to a device""" status: Optional[str] = "ok"