diff --git a/network_importer/adapters/nautobot_api/models.py b/network_importer/adapters/nautobot_api/models.py index f2fe3f64..068dd3d7 100644 --- a/network_importer/adapters/nautobot_api/models.py +++ b/network_importer/adapters/nautobot_api/models.py @@ -519,8 +519,13 @@ def translate_attrs_for_nautobot(self, attrs): ) continue - tag_id = device.get_device_tag_id() - nb_params["tags"].append(tag_id) + try: + tag_id = device.get_device_tag_id() + if tag_id: + nb_params["tags"].append(tag_id) + except pynautobot.core.query.RequestError: + # If there is an error with tag retrieval, ignore tags + LOGGER.warning("Error with tag retrieval for device %s. Ignoring.", device_name) return nb_params