Closed tom0010 closed 1 month ago
Similar to https://github.com/ktbyers/netmiko/issues/2663 and https://github.com/ktbyers/netmiko/issues/1770 which were closed and not actioned on.
This would be handy for sure
Looks like https://github.com/ktbyers/netmiko/pull/3406/files will fix this.
Description of Issue/Question
We are using NTC templates with Netmiko and we have identified that some calls to devices are returning the raw_output from the device instead when trying to parse a template. We would like to have a flag to return an error if Netmiko was unable to parse the TextFSM template.
Our use case is because Netmiko is returning back the raw_output if it cannot parse, and we cannot handle this appropriately and we do not know if an error occurred.
Setup
Netmiko version
4.4.0
Netmiko device_type (if relevant to the issue)
N/A
Steps to Reproduce the Issue
Error Traceback
N/A
Relevant Python code
The issue is identified here: https://github.com/ktbyers/netmiko/blob/v4.4.0/netmiko/utilities.py#L331-L352
We would like to have an error returned back, so after Netmiko returns we can continue to process, knowing that an error occurred. Right now, our application is not getting an error but a string back, therefore it assumes this is ok. We cannot do detection on
if isinstance(cmd_output, str):
because we don't always use templating,show run
is an example of this.Potential fix/enhancement:
This proposal would not change the current behaviour.