fgimian / paramiko-expect

A Python expect-like extension for the Paramiko SSH library which also supports tailing logs.
MIT License
204 stars 78 forks source link

invalid output #58

Open dorelmoremgil opened 4 years ago

dorelmoremgil commented 4 years ago

Hi, when I use paramiko-expect, sometimes the output is invalid. To be specific, the printed cmd_output_2 is in fact output for some_command1. Sample code below.


        with SSHClientInteraction(client, timeout=10, display=False) as interact:
            interact.send('some_command1')
            interact.expect("some_prompt> ")
              cmd_output_1 = interact.current_output_clean
            interact.send('some_command2')
            interact.expect("some_prompt> ")
            cmd_output_2 = interact.current_output_clean
            #and later print (cmd_output_1) and print (cmd_output_2)
fruch commented 3 years ago

can you supply more information ?

sar772004 commented 3 years ago

Please check 0.3.0, should have a fix for this. If it works for you we can close thi