[paramiko] Add timeout for exe_command() ?
Wan Li
wanliyou at gmail.com
Fri Jan 15 02:18:28 PST 2010
> Shall I simply call ssh.close() first and login again to make the retry
> works? Or maybe there is a way to cancel the exe_command?
>
>
I spend some time looking into paramiko. Here are thoughts in my mind,
correct me if I'm wrong. :-)
Basically, we initialize a SSHClient, call connect() to establish the
connection(a new Transport), exe_command will call the open_session() to add
a new channel for this transport which will be stored in
Transport._channels. If I wanna cancel the exe_command, the best way may be
simply call *ssh._transport._channels[ssh._transport.channel_count].close()*to
close the previous channel and call the exe_command() again.
Any comments?
--
>: ~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lag.net/pipermail/paramiko/attachments/20100115/be6067a6/attachment.html>
More information about the paramiko
mailing list