Red Hat Bugzilla – Bug 976504
pxssh.py wrong timeout
Last modified: 2015-08-19 03:52:31 EDT
Description of problem:
cannot use pxssh.py which is part of pexpect, always running into timeout:
Version-Release number of selected component (if applicable):
echo <<EOF > ssh.py
s = pxssh.pxssh()
if not s.login ('localhost', 'myuser', 'mypass'):
print "SSH session failed on login."
print "SSH session login successful"
s.sendline ('ls -l')
s.prompt() # match the prompt
print s.before # print everything before the prompt.
Steps to Reproduce:
1. python ssh.py
2. see error msg
Traceback (most recent call last):
File "ssh.py", line 3, in <module>
if not s.login ('localhost', 'myuser', 'mypassword'):
File "/usr/lib/python2.6/site-packages/pxssh.py", line 243, in login
if not self.synch_original_prompt():
File "/usr/lib/python2.6/site-packages/pxssh.py", line 134, in synch_original_prompt
self.read_nonblocking(size=10000,timeout=1) # GAS: Clear out the cache before getting the prompt
File "/usr/lib/python2.6/site-packages/pexpect.py", line 815, in read_nonblocking
r,w,e = self.__select([self.child_fd], , , timeout)
File "/usr/lib/python2.6/site-packages/pexpect.py", line 1549, in __select
return select.select (iwtd, owtd, ewtd, timeout)
Output of ssh command "ls -l"
add this before line 134, and it works as expected.
This should also affect rhel5 pexpect package, but not verified.
Thanks for bugreport. According to my research it is enough to just add
can you confirm it too? I would prefer not to add additional delays if it is not necessary.
it requires python3 which will be in rhel7 only partially and fence-agents were not tested with it at all
package renaming -> it was obtained from fedora and no-one complained, otherwise it will be fixed; this way we have to wait for rhel8