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
Better handling of errors when the config is loaded.
Observed Behavior
Nornir play fails with a exception.
Steps to Reproduce
Don't configure the default secret_access_type for a platform
Launch a Golden Config backup job
See the Advanced tab of the job result.
Traceback:
Traceback (most recent call last):
File "/opt/nautobot/.local/lib/python3.11/site-packages/nautobot_golden_config/jobs.py", line 173, in gc_repo_wrapper
func(self, *args, **kwargs)
File "/opt/nautobot/.local/lib/python3.11/site-packages/nautobot_golden_config/jobs.py", line 287, in run
config_backup(self)
File "/opt/nautobot/.local/lib/python3.11/site-packages/nautobot_golden_config/nornir_plays/config_backup.py", line 121, in config_backup
replace_regex_dict[regex.platform.network_driver].append({"replace": regex.replace, "regex": regex.regex})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/nautobot/.local/lib/python3.11/site-packages/nornir/init_nornir.py", line 71, in InitNornir
inventory=load_inventory(config),
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/nautobot/.local/lib/python3.11/site-packages/nornir/init_nornir.py", line 20, in load_inventory
inv = inventory_plugin(**config.inventory.options).load()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/nautobot/.local/lib/python3.11/site-packages/nautobot_plugin_nornir/plugins/inventory/nautobot_orm.py", line 205, in load
host = self.create_host(device=device, cred=cred, params=self.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/nautobot/.local/lib/python3.11/site-packages/nautobot_plugin_nornir/plugins/inventory/nautobot_orm.py", line 265, in create_host
username, password, secret (redacted) cred.get_device_creds(device=device) # pylint:disable=unused-variable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/nautobot/.local/lib/python3.11/site-packages/nautobot_plugin_nornir/plugins/credentials/nautobot_secrets.py", line 139, in get_device_creds
configured_access_type = _get_access_type_value(device)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/nautobot/.local/lib/python3.11/site-packages/nautobot_plugin_nornir/plugins/credentials/nautobot_secrets.py", line 44, in _get_access_type_value
access_type_str = device_obj.get_config_context()["nautobot_plugin_nornir"]["secret_access_type"].upper()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'nautobot_plugin_nornir'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 477, in trace_task
R = retval = fun(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/celery/app/trace.py", line 760, in __protected_call__
return self.run(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/nautobot/extras/jobs.py", line 1234, in run_job
result = job(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/nautobot/extras/jobs.py", line 160, in __call__
return self.run(*args, **deserialized_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/nautobot/.local/lib/python3.11/site-packages/nautobot_golden_config/jobs.py", line 178, in gc_repo_wrapper
raise NornirNautobotException(error_msg) from error
nornir_nautobot.exceptions.NornirNautobotException: `E3001:` General Exception handler, original error message ```'nautobot_plugin_nornir'```
The text was updated successfully, but these errors were encountered:
Environment
Expected Behavior
Better handling of errors when the config is loaded.
Observed Behavior
Nornir play fails with a exception.
Steps to Reproduce
Traceback:
The text was updated successfully, but these errors were encountered: