Bug 1261763 - preupg fails in case of redirected stdin
preupg fails in case of redirected stdin
Status: CLOSED DUPLICATE of bug 1231410
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: preupgrade-assistant (Show other bugs)
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Petr Hracek
Alois Mahdal
: Extras
Depends On:
  Show dependency treegraph
Reported: 2015-09-10 02:45 EDT by Marian Ganisin
Modified: 2015-09-10 03:14 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-09-10 03:14:47 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Marian Ganisin 2015-09-10 02:45:12 EDT
Description of problem:

This kind of execution:

# yes | preupg --debug

causes following traceback:

Traceback (most recent call last):
  File "/usr/bin/preupg", line 33, in <module>
  File "/usr/bin/preupg", line 20, in main
    ret = app.run()
  File "/usr/lib/python2.6/site-packages/preup/application.py", line 680, in run
    tarball_path = self.scan_system()
  File "/usr/lib/python2.6/site-packages/preup/application.py", line 516, in scan_system
  File "/usr/lib/python2.6/site-packages/preup/application.py", line 290, in run_scan_process
  File "/usr/lib/python2.6/site-packages/preup/application.py", line 307, in run_scan
    return run_subprocess(cmd, print_output=False, function=function)
  File "/usr/lib/python2.6/site-packages/preup/utils.py", line 140, in run_subprocess
  File "/usr/lib/python2.6/site-packages/preup/scanning.py", line 86, in show_progress
    self.width_size = int(ScanProgress.get_terminal_width()[1])
IndexError: list index out of range

I can just guess get ScanProgress.get_terminal_width reads attributes of stdin, however in this case stdin isn't tty.

Version-Release number of selected component (if applicable):

How reproducible:
write to stdin of preupg via pipe

Steps to Reproduce:
1. yes | preupg

Actual results:
Traceback raised.

Expected results:
No traceback
Comment 2 Petr Hracek 2015-09-10 03:14:47 EDT

*** This bug has been marked as a duplicate of bug 1231410 ***

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