AsyncSSH and timeout

mantaselprj at gmail.com mantaselprj at gmail.com
Thu Oct 27 05:34:20 EDT 2016


Good day,
I'm trying to run multiple SSH clients using AsyncSSH lib. This is an example from manual, which works fine:
http://pastebin.com/zh4zymeQ

The problem is, it is not possible to directly set connect timeout in run_client() function. However, the manual says: 
"asyncio calls can be wrapped in a call to asyncio.wait_for() or asyncio.wait() which takes a timeout and provides equivalent functionality."

So I tried to modify run_client() like this:
http://pastebin.com/mH7pBuuf

But it spits out a syntax error. I also tried countless variations of it, but still no luck. Could someone more knowledgeable help me to set the damn timeout?



More information about the Python-list mailing list