You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set up the network devices in Nautobot, without using any tags
Run Network Importer on Cisco IOS devices
Expected Behavior
The vlans and other device data should import correctly.
Observed Behavior
I found an issue that is causing the vlans to not properly import if Network Importer is unable to retrieve device tags. I am not sure the exact nature of what is causing this, but I've narrowed it down to these two lines throwing the exception:
The issue I'm seeing is as follows (sensitive data replaced with generic names):
2022-09-06 18:37:08,247 - network-importer - WARNING - Unable to create Vlan {'vid': 4, 'site_name': 'remote-office'} in Nautobot ({"slug":["Enter a valid \"slug\" consisting of letters, numbers, underscores or hyphens."]})
2022-09-06 18:37:08,247 - diffsync.helpers - WARNING - 2022-09-06 18:37.08 [warning ] vlan create did not return the model object. [diffsync.helpers] action=create diffs={'+': {'name': 'ADMIN_VLAN', 'associated_devices': ['switch01.acme.com']}} dst=<Nautobot> flags=<DiffSyncFlags.NONE: 0> model=vlan src=<Network> status=failure unique_id=remote-office__4
2022-09-06 18:37:08,248 - diffsync.helpers - WARNING - 2022-09-06 18:37.08 [warning ] No object resulted from sync, will not process child objects. [diffsync.helpers] action=create diffs={'+': {'name': 'ADMIN_VLAN', 'associated_devices': ['switch01.acme.com']}} dst=<Nautobot> flags=<DiffSyncFlags.NONE: 0> model=vlan src=<Network> unique_id=remote-office__4
I propose since tags are optional, we add a simple try/except block to catch an exception, and just pass over the tags. In my testing, this successfully worked around the bug.
The text was updated successfully, but these errors were encountered:
Environment
Steps to Reproduce
import_vlan = "cli"
Expected Behavior
The vlans and other device data should import correctly.
Observed Behavior
I found an issue that is causing the vlans to not properly import if Network Importer is unable to retrieve device tags. I am not sure the exact nature of what is causing this, but I've narrowed it down to these two lines throwing the exception:
https://github.com/networktocode/network-importer/blob/develop/network_importer/adapters/nautobot_api/models.py#L522-L523
The issue I'm seeing is as follows (sensitive data replaced with generic names):
I propose since tags are optional, we add a simple try/except block to catch an exception, and just pass over the tags. In my testing, this successfully worked around the bug.
The text was updated successfully, but these errors were encountered: