Replies: 1 comment 7 replies
-
Netmiko's send_command automatically strips trailing whitespace by default. Try: show_mac = net_connect.send_command(f"show mac add | i {j} ", normalize=False) |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
Can somebody please help me? I am trying to send the "show mac add | i Gig1/0/1 ' command with white space at the end, because otherwise other interfaces are matched too (for example, Gig1/0/10, Gig1/0/11 and so forth and so on). I need only Gig1/0/1, but it looks like that the pattern that netmiko uses ignores the white space:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'show mac add | i Gi1/0/1\n'
DEBUG:netmiko:Pattern is: show\ mac\ add\ |\ i\ Gi1/0/1
DEBUG:netmiko:_read_channel_expect read_data: s
DEBUG:netmiko:_read_channel_expect read_data: how mac add | i Gi1/0/1
Here's my code:
Beta Was this translation helpful? Give feedback.
All reactions