Bug 713449

Summary: sosreport truncates leading and trailing whitespace from command outputs
Product: Red Hat Enterprise Linux 6 Reporter: Bryan Yount <byount>
Component: sosAssignee: Bryn M. Reeves <bmr>
Status: CLOSED ERRATA QA Contact: David Kutálek <dkutalek>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: agk, bmr, byount, dkutalek, gavin, kroberts, prc
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: 2.2-11.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 18:11:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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):
sos-2.2-8.el6.noarch


How reproducible:
Very


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.

http://rhn.redhat.com/errata/RHSA-2011-1536.html