Closed andershagman closed 4 months ago
Hello @andershagman Please confirm the version of NTC templates and Netmiko that you're using. What Cisco device and what version of code is that device running?
In my tests thus far TextFSM produces an empty list with the current template and some example output I have which has no etherchannels.
Thank you.
Hello @andershagman Netmiko is supplying this behavior and Netmiko is behaving as it was coded. If there's an empty list returned then raw output is sent back (see below Github hyperlink). https://github.com/ktbyers/netmiko/blob/develop/netmiko/utilities.py#L346
You might consider type()
checking of your output variable since if it's a string it is probably the raw output. Otherwise if the template has an issue textfsm would raise exceptions.
NTC templates/textfsm is sending an empty list back as my vanilla textfsm tests return []
. However as noted above Netmiko tests for an empty list when it determines whether to send back the raw unstructured CLI output.
Hi
Thanks for the explanation. I have used a workaround to not send the command if no po# interface.
MHV /Anders Hagman
22 juni 2024 kl. 22:17 skrev Michael Bear @.***>:
Hello @andershagman Netmiko is supplying this behavior and Netmiko is behaving as it was coded. If there's an empty list returned then raw output is sent back (see below Github hyperlink). https://github.com/ktbyers/netmiko/blob/develop/netmiko/utilities.py#L346
You might consider type() checking of your output variable since if it's a string it is probably the raw output. Otherwise if the template has an issue textfsm would raise exceptions.
NTC templates/textfsm is sending an empty list back as my vanilla textfsm tests return []. However as noted above Netmiko tests for an empty list when it determines whether to send back the raw unstructured CLI output.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
ISSUE TYPE
TEMPLATE USING
cisco_ios_show_etherchannel_summary.textfsm
SAMPLE COMMAND OUTPUT
SUMMARY
When using the template with show etherchannel summary on a switch that does not have a port-channel you get the raw screen output instead of Null.
STEPS TO REPRODUCE
Just use the command show etherchannel summary with netmiko
EXPECTED RESULTS
Empty dict
ACTUAL RESULTS