When I am running nornir_napalm with the iosxr_netconf driver the connection fails, because nornir_napalm adds a argument called ssh_config_file that is passed on to ncclient in NAPALM, which does not expect that argument.
from nornir import InitNornir
from nornir_utils.plugins.functions import print_result
from nornir.core.plugins.connections import ConnectionPluginRegister
from nornir_napalm.plugins.connections import Napalm
from nornir_napalm.plugins.tasks import napalm_get
ConnectionPluginRegister.register("nornir-napalm", Napalm)
nr = InitNornir(config_file="config.yaml")
result = nr.run(task=napalm_get, getters=["get_config"])
print_result(result)
SSHSession.connect() got an unexpected keyword argument 'ssh_config_file'
napalm_get**********************************************************************
* p-1 ** changed : False *******************************************************
vvvv napalm_get ** changed : False vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv ERROR
Traceback (most recent call last):
File "/home/jo/projects/isis-tests/nornir/venv/lib/python3.11/site-packages/napalm/iosxr_netconf/iosxr_netconf.py", line 83, in open
self.device = manager.connect(
^^^^^^^^^^^^^^^^
File "/home/jo/projects/isis-tests/nornir/venv/lib/python3.11/site-packages/ncclient/manager.py", line 187, in connect
return connect_ssh(*args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jo/projects/isis-tests/nornir/venv/lib/python3.11/site-packages/ncclient/manager.py", line 139, in connect_ssh
session.connect(*args, **kwds)
TypeError: SSHSession.connect() got an unexpected keyword argument 'ssh_config_file'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jo/projects/isis-tests/nornir/venv/lib/python3.11/site-packages/nornir/core/task.py", line 99, in start
r = self.task(self, **self.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jo/projects/isis-tests/nornir/venv/lib/python3.11/site-packages/nornir_napalm/plugins/tasks/napalm_get.py", line 32, in napalm_get
device = task.host.get_connection(CONNECTION_NAME, task.nornir.config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/jo/projects/isis-tests/nornir/venv/lib/python3.11/site-packages/nornir/core/inventory.py", line 494, in get_connection
self.open_connection(
File "/home/jo/projects/isis-tests/nornir/venv/lib/python3.11/site-packages/nornir/core/inventory.py", line 546, in open_connection
conn_obj.open(
File "/home/jo/projects/isis-tests/nornir/venv/lib/python3.11/site-packages/nornir_napalm/plugins/connections/__init__.py", line 57, in open
connection.open()
File "/home/jo/projects/isis-tests/nornir/venv/lib/python3.11/site-packages/napalm/iosxr_netconf/iosxr_netconf.py", line 97, in open
raise ConnectionException(conn_err.args[0])
napalm.base.exceptions.ConnectionException: SSHSession.connect() got an unexpected keyword argument 'ssh_config_file'
When I am running nornir_napalm with the iosxr_netconf driver the connection fails, because nornir_napalm adds a argument called
ssh_config_file
that is passed on to ncclient in NAPALM, which does not expect that argument.Versions used:
Here is my code:
With this config:
And this inventory:
This results in this error: