ktbyers / netmiko

Multi-vendor library to simplify Paramiko SSH connections to network devices
MIT License
3.56k stars 1.3k forks source link

handling of "command not found" error in send methods #3418

Open shrmk opened 5 months ago

shrmk commented 5 months ago

Description of Issue/Question

I have many send methods (simple and multiline) used at various places for various reasons. This is not elegant way to capture output at each and every send command to check common errors which may response from device. When ever device responses if any of these common errors (strings), an exception must be raised.

How can we handle this situation ?

Setup

Netmiko version

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

netmiko==4.3.0

Netmiko device_type (if relevant to the issue)

(Paste device_type between quotes below)

a new device added

Steps to Reproduce the Issue

Error Traceback

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

Relevant Python code

(Please try to essentialize your Python code to the minimum code needed to reproduce the issue) (Paste the code between the quotes below)

ktbyers commented 4 months ago

How do you want to handle it?

You sent the wrong command, I would just code into my Python code what to do in this case (raise an exception, continue onward, do something else).