Skip to content

Define custom ssh_config_file for host  #409

@fakrulalam-git

Description

@fakrulalam-git

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions