Skip to content

Commit

Permalink
Merge pull request #281 from matt852/280-workaround
Browse files Browse the repository at this point in the history
Add extra error handling for creating vlans
  • Loading branch information
matt852 authored Dec 1, 2022
2 parents 1872b82 + 83b1897 commit 9e36624
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions network_importer/adapters/nautobot_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9e36624

Please sign in to comment.