Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define custom ssh_config_file for host #409

Open
fakrulalam-git opened this issue Feb 26, 2024 · 0 comments
Open

Define custom ssh_config_file for host #409

fakrulalam-git opened this issue Feb 26, 2024 · 0 comments

Comments

@fakrulalam-git
Copy link

Description of Issue/Question

Under host can we define custom ssh_config_file file

Setup

Using a sample host config to validate physical-interface status change
config_check.yml

    hosts:
      - device: core01.device01
        username: username
    tests:
      - test_no_diff.yml 

test_no_diff.yml

  - command: show interfaces terse lo* 
  - iterate:
      xpath: physical-interface
      id: './name'
      tests:
        - no-diff: oper-status       # element in which test is performed
          err: "Test Failed!! oper-status  got changed, before it was <{{pre['oper-status']}}>, now it is <{{post['oper-status']}}>"
          info: "Test Passed!! oper-status is same, before it is <{{pre['oper-status']}}> now it is <{{post['oper-status']}}>"

Steps to Reproduce Issue

jsnapy --snap pre -f config_check.yml

Traceback (most recent call last):
  File "/Users/fakrul/.pyenv/versions/3.9.0/lib/python3.9/threading.py", line 950, in _bootstrap_inner
    self.run()
  File "/Users/fakrul/.pyenv/versions/3.9.0/lib/python3.9/threading.py", line 888, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/fakrul/.pyenv/versions/3.9.0/lib/python3.9/site-packages/jnpr/jsnapy/jsnapy.py", line 694, in connect
    raise Exception(ex)
Exception: ConnectError(host: core01.device01, msg: Negotiation failed: Error reading SSH protocol banner)

Error in log:

# tail -f /var/log/jsnapy/jsnapy.log
ERROR occurred ConnectError(host: core01.device01, msg: Negotiation failed: Error reading SSH protocol banner)
2024-02-26 15:41:52,848 - jnpr.jsnapy.jsnapy - DEBUG -
 jsnapy.cfg file location used : /etc/jsnapy
2024-02-26 15:41:52,849 - jnpr.jsnapy.jsnapy - DEBUG -
 Configuration file location used : /etc/jsnapy
2024-02-26 15:41:52,852 - jnpr.jsnapy.jsnapy - INFO -
 Connecting to device core01. device01 ................
2024-02-26 15:42:08,544 - jnpr.jsnapy.jsnapy - ERROR -

ERROR occurred ConnectError(host: core01.device01, msg: Negotiation failed: Error reading SSH protocol banner)

Versions Report

JSNAPy version: 1.3.7
Python 3.9.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant