Generic Send / Expect Devices - Response returns for prior command. #2907
iunderwood
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working on a script that leverages netmiko to complete onboarding for a number of managed PDUs from BayTech. I am using netmiko 4.1.2.
From what I have been able to tell from the documentation and threads around the Internet, the proper device type to use for this is the "terminal_server" variety. The initial output upon connect is pretty lengthy, so I do specify a base prompt ">" as such:
Once I get the prompt, the next step is to go into command mode, which is a defined attention character sent 5 times, which works in the code as well. I use command timing since the sequence is not visible, and the previous prompt is no longer available:
This is the part where I am somewhat stuck: I want to use a list of tuples that define the command I want to output, followed by the prompt I am waiting for to advance to the next command in the list:
I process this command set through a loop as such:
What I am finding is that the value of command_response is actually from the results of the prior run through the loop, which throws off the error check, and I need to move the conditions in the list down:
I have some logger output as below (cut in after the login is mostly done). After my debug statement where "Config Mode Active" is shows, the first output is from the last send_command_timing statement, which
I'm not even sure where to dig in to find out why the command and it's subsequent output is staggered.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions