1

I am using client.exec_command to run several commands consecutively but seems it's non-blocking. Sometimes I want to wait for a command to finish before running the next one. I know I can utilize a channel's API chan.exec_command and wait on it's exit status, which works but the channel closes after running the command and I have to start a new channel each time for the next command. What I'm looking for is some clean solution that run multiple commands consecutively and wait on each one, just like how a person doing it manually.

New to Python too. Any comment is welcome. Thanks.

Derek
  • 1,085
  • 2
  • 20
  • 36
  • Yeah, this seems to be what you are looking for: http://stackoverflow.com/a/6203953/637754 – Governa Dec 17 '13 at 23:56
  • thank you both for timely replying. I actually noticed that question, but didn't give the solution a try as it's still running client.exec_commands so I was guessing it would still be nonblocking. Any idea? – Derek Dec 18 '13 at 00:00

0 Answers0