Bug 1441779

Summary: pssh -I fails with python exception "TypeError: a bytes-like object is required, not 'str'"
Product: [Fedora] Fedora Reporter: Inaky Perez-Gonzalez <inaky.perez-gonzalez>
Component: psshAssignee: Terje Røsten <terje.rosten>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 25CC: amcnabb, terje.rosten
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pssh-2.3.1-18.fc24 pssh-2.3.1-18.fc25 pssh-2.3.1-18.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-30 21:27:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Inaky Perez-Gonzalez 2017-04-12 17:21:44 UTC
Description of problem:

When using -I to feed standard input to a pssh process, a python exception is raised.


Version-Release number of selected component (if applicable):
$ rpm -q pssh
pssh-2.3.1-15.fc25.noarch


How reproducible:
Always

Steps to Reproduce:
$ echo hello | pssh -I -H hostname.domainname ls
Traceback (most recent call last):
  File "/usr/bin/pssh", line 118, in <module>
    do_pssh(hosts, cmdline, opts)
  File "/usr/bin/pssh", line 89, in do_pssh
    statuses = manager.run()
  File "/usr/lib/python3.5/site-packages/psshlib/manager.py", line 75, in run
    self.iomap.poll(wait)
  File "/usr/lib/python3.5/site-packages/psshlib/manager.py", line 257, in poll
    handler(fd, self)
  File "/usr/lib/python3.5/site-packages/psshlib/task.py", line 170, in handle_stdin
    self.byteswritten = start + os.write(fd, chunk)
TypeError: a bytes-like object is required, not 'str'



Actual results: Exception


Expected results: No exception, normal operation and "hello" fed to the pssh process


Additional info:
The pssh project in code.google.com hsa been abandoned. More development is happening in github https://github.com/lilydjwg/pssh/commits/master, which fixes this issue in one of the last commits. 

Archlinux has a report and fix for this in https://bugs.archlinux.org/task/51533, same fix as above, verified by me to work in F25.

Comment 1 Terje Røsten 2017-04-13 13:10:43 UTC
Thanks for report, I will integrate these fixes.

Comment 2 Fedora Update System 2017-05-21 10:42:25 UTC
pssh-2.3.1-18.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-669ee69e85

Comment 3 Fedora Update System 2017-05-21 10:42:34 UTC
pssh-2.3.1-18.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-d75ef53705

Comment 4 Fedora Update System 2017-05-21 10:42:39 UTC
pssh-2.3.1-18.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-52dc34d3ab

Comment 5 Fedora Update System 2017-05-21 23:32:56 UTC
pssh-2.3.1-18.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-52dc34d3ab

Comment 6 Fedora Update System 2017-05-22 09:25:46 UTC
pssh-2.3.1-18.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-669ee69e85

Comment 7 Fedora Update System 2017-05-22 09:28:38 UTC
pssh-2.3.1-18.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-d75ef53705

Comment 8 Inaky Perez-Gonzalez 2017-05-22 17:02:17 UTC
Verified to work on F25 with pssh-2.3.1-18.fc25.noarch

Thank you!

Comment 9 Fedora Update System 2017-05-30 21:27:20 UTC
pssh-2.3.1-18.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2017-05-31 09:03:13 UTC
pssh-2.3.1-18.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2017-06-09 19:04:49 UTC
pssh-2.3.1-18.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.