I am using Paramiko to automate few tasks in switch. The Switch OS is not based on unix/linux kind. So I must have to use interactive shell.
Now I am facing issue, without completing first command it is executing second command. I can use time delay between commands but i am thinking it is not right way to automate thing.
Below is the code:
import paramiko
remote_conn_pre = paramiko.SSHClient()
remote_conn_pre.set_missing_host_key_policy(
paramiko.AutoAddPolicy())
remote_conn_pre.connect(ip, username, password,look_for_keys=False, allow_agent=False)
remote_conn = remote_conn_pre.invoke_shell()
remote_conn.send("\n")
remote_conn.send("ping 10.10.10.10\n")
remote_conn.send("\n")
remote_conn.send("ping 10.10.10.10\n")
Could you Please any one can help me out how to use paramiko that is script has to wait until one command finishes the task and move to next command.