RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 976504 - pxssh.py wrong timeout
Summary: pxssh.py wrong timeout
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: pexpect
Version: 6.3
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Marek Grac
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-20 17:15 UTC by Benjamin
Modified: 2015-08-19 07:52 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-19 07:52:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Benjamin 2013-06-20 17:15:44 UTC
Description of problem:
cannot use pxssh.py which is part of pexpect, always running into timeout:



Version-Release number of selected component (if applicable):
pexpect-2.3-6.el6.noarch

How reproducible:
echo <<EOF > ssh.py
import pxssh
s = pxssh.pxssh()
if not s.login ('localhost', 'myuser', 'mypass'):
    print "SSH session failed on login."
    print str(s)
else:
    print "SSH session login successful"
    s.sendline ('ls -l')
    s.prompt()         # match the prompt
    print s.before     # print everything before the prompt.
    s.logout()
EOF

Steps to Reproduce:
1. python ssh.py
2. see error msg

Actual results:
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)


Expected results:
Output of ssh command "ls -l"

Additional info:
Fix:
132a133,134
>         self.sendline()
>         time.sleep(0.5)

add this before line 134, and it works as expected.
This should also affect rhel5 pexpect package, but not verified.

Comment 2 Marek Grac 2013-06-24 09:30:22 UTC
@Benjamin:

Thanks for bugreport. According to my research it is enough to just add 

self.sendline()

can you confirm it too? I would prefer not to add additional delays if it is not necessary.

Comment 6 Marek Grac 2014-04-30 14:05:41 UTC
@Alan: 

pexpect-u ->
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


Note You need to log in before you can comment on or make changes to this bug.