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)
6.7
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Petr Hracek
Alois Mahdal
: Extras
Depends On:
Blocks:
  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:
Environment:
Last Closed: 2015-09-10 03:14:47 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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:

preupg
This kind of execution:

# yes | preupg --debug

causes following traceback:

Traceback (most recent call last):
  File "/usr/bin/preupg", line 33, in <module>
    sys.exit(main())
  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
    self.run_scan_process()
  File "/usr/lib/python2.6/site-packages/preup/application.py", line 290, in run_scan_process
    self.run_scan(function=self.scanning_progress.show_progress)
  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
    function(stdout_data.decode(settings.defenc))
  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):
preupgrade-assistant-2.1.0-7.el6.x86_64

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.