Bug 713449 - sosreport truncates leading and trailing whitespace from command outputs
Summary: sosreport truncates leading and trailing whitespace from command outputs
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sos
Version: 6.1
Hardware: Unspecified
OS: Linux
Target Milestone: rc
: ---
Assignee: Bryn M. Reeves
QA Contact: David Kutálek
Depends On:
TreeView+ depends on / blocked
Reported: 2011-06-15 12:59 UTC by Bryan Yount
Modified: 2011-12-06 18:11 UTC (History)
7 users (show)

Fixed In Version: 2.2-11.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-12-06 18:11:09 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1536 normal SHIPPED_LIVE Low: sos security, bug fix, and enhancement update 2011-12-06 01:02:03 UTC

Description Bryan Yount 2011-06-15 12:59:55 UTC
Description of problem:
The sosreport utility in RHEL 6 is stripping out leading and trailing whitespace from the captured output of commands.  This could lead to confusion and misreading of sos data.

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

How reproducible:

Steps to Reproduce:
1. Run sosreport
2. View command output captured in report
3. Compare with actual command output

Actual results:

# cat free 
total       used       free     shared    buffers     cached
Mem:       3922400    1184348    2738052          0       6936     628912
-/+ buffers/cache:     548500    3373900
Swap:      6160376          0    6160376

Expected results:

# free
             total       used       free     shared    buffers     cached
Mem:       3922400    1096932    2825468          0      12572     642716
-/+ buffers/cache:     441644    3480756
Swap:      6160376          0    6160376

Additional information:
Looks like the issue is in helpers.py line 58 in function 'sosGetCommandOutput' where it returns "stdout.strip()"

Comment 2 Bryn M. Reeves 2011-06-15 16:31:39 UTC
I just tracked down the changeset that introduced this upstream (it's in 1.9 but not prior releases) as I suspected there's no rationale for the change given. This seems completely bogus to me and as comment #0 indicates breaks, or at least makes confusing, many standard command's outputs (I'm surprised nobody noticed already!).

I'm for reverting this upstream and in RHEL6 asap as it will also affect comparison between sos data when we do make the change.

Keith, thoughts?

Comment 5 errata-xmlrpc 2011-12-06 18:11:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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