napalm: IOSXR_NETCONF: Certain SSH arguments not supported

IOSXR_NETCONF SSHException, optional args do not work

When connecting via iosxr_netconf I get an exception:

napalm.base.exceptions.ConnectionException: SSHException(‘No existing session’)

I can get it to work by modifying iosxr_netconf.py to force it to use the optional args:

                hostkey_verify=False,
                look_for_keys=False, 
                allow_agent=False,

But iosxr_netconf doesn’t use those optional args if you attempt to supply them using

--optional_args 'hostkey_verify=False, look_for_keys=False, allow_agent=False'

Also doesn’t work if you use them via optional args in the driver init.

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

(Place an x between the square brackets where applicable)

  • Yes
  • [] No

Setup

napalm version

(Paste verbatim output from pip freeze | grep napalm between quotes below)

-e git+https://github.com/napalm-automation/napalm.git@be82be0651a0a3cef7388f9b0af0205e9f1f8d10#egg=napalm

Network operating system version

(Paste verbatim output from show version - or equivalent - between quotes below)

Cisco IOS XR Software, Version 6.5.3[Default]

cisco ASR9K Series (P4040) processor with 8388608K bytes of memory.
P4040 processor at 1500MHz, Revision 2.0
ASR-9001 Chassis

Steps to Reproduce the Issue

napalm --vendor iosxr_netconf --user $user --password $pw $host call get_facts

Error Traceback

(Paste the complete traceback of the exception between quotes below)

================= Traceback =================

Traceback (most recent call last):
  File "/Users/gagne/dev/napalm/napalm/napalm/iosxr_netconf/iosxr_netconf.py", line 84, in open
    self.device = manager.connect(
  File "/Users/gagne/.pyenv/versions/3.8.7/lib/python3.8/site-packages/ncclient/manager.py", line 168, in connect
    return connect_ssh(*args, **kwds)
  File "/Users/gagne/.pyenv/versions/3.8.7/lib/python3.8/site-packages/ncclient/manager.py", line 135, in connect_ssh
    session.connect(*args, **kwds)
  File "/Users/gagne/.pyenv/versions/3.8.7/lib/python3.8/site-packages/ncclient/transport/ssh.py", line 362, in connect
    self._auth(username, password, key_filenames, allow_agent, look_for_keys)
  File "/Users/gagne/.pyenv/versions/3.8.7/lib/python3.8/site-packages/ncclient/transport/ssh.py", line 464, in _auth
    raise AuthenticationError(repr(saved_exception))
ncclient.transport.errors.AuthenticationError: SSHException('No existing session')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/gagne/.pyenv/versions/3.8.7/bin/napalm", line 33, in <module>
    sys.exit(load_entry_point('napalm', 'console_scripts', 'napalm')())
  File "/Users/gagne/dev/napalm/napalm/napalm/base/clitools/cl_napalm.py", line 308, in main
    run_tests(args)
  File "/Users/gagne/dev/napalm/napalm/napalm/base/clitools/cl_napalm.py", line 283, in run_tests
    call_open_device(device)
  File "/Users/gagne/dev/napalm/napalm/napalm/base/clitools/cl_napalm.py", line 27, in wrapper
    r = func(*args, **kwargs)
  File "/Users/gagne/dev/napalm/napalm/napalm/base/clitools/cl_napalm.py", line 207, in call_open_device
    return device.open()
  File "/Users/gagne/dev/napalm/napalm/napalm/iosxr_netconf/iosxr_netconf.py", line 98, in open
    raise ConnectionException(conn_err.args[0])
napalm.base.exceptions.ConnectionException: SSHException('No existing session')

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 1
  • Comments: 22 (14 by maintainers)

Most upvoted comments

@ktbyers there’s been no movement on the pull request I’ve submitted to resolve this issue. Is there something else I need to do to have it reviewed and merged? First time contributing to a project like this so I’m not sure of the process

Just to confirm, that resolved it for me