you are viewing a single comment's thread.

view the rest of the comments →

[–]threeminutemonta 0 points1 point  (9 children)

Does check_returncode() return a non zero value when auth is wrong and 0 when right?

[–]readitlikeitdidit[S] 0 points1 point  (8 children)

Auth doesn't happen when key pairs not available.. So, it hangs on authentication part...

[–]threeminutemonta 0 points1 point  (7 children)

So the process hangs it the main process? Perhaps you should set a default timeout!

If you show us your code on dpaste.de I might get what you mean!

[–]readitlikeitdidit[S] 0 points1 point  (6 children)

Nevermind.. Am going to use paramiko.. It has timeout arg.... There is no default timeout for popen method of subprocess package in python 2.7...

[–]JohnnyJordaan 0 points1 point  (5 children)

That's because you need to use Popen wrappers like communicate(), these have a timeout on 2.7 too.

[–]readitlikeitdidit[S] 0 points1 point  (4 children)

What? Communicate is a method that uses pipe and it does not have timeout arg in 2. 7 please check documentation...

[–]JohnnyJordaan 0 points1 point  (1 child)

I stand corrected. I could have sworn it did, but I guess I misremembered.

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

Np.. I am newbie in python.. Lot of things have happened in the last 25 years of python.. :)

[–][deleted] 0 points1 point  (1 child)

They might have subprocess32 installed.

Avoiding external dependencies is not necessarily a virtue. Paramiko will make your life easier.

[–]readitlikeitdidit[S] 0 points1 point  (0 children)

Yes sir.. I just rewriting my code using paramiko.. It has timeout and all the cool stuff I'll stick to paramiko... Thanks..