Bug 850433 - One redundant new line char in gathered commands
One redundant new line char in gathered commands
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sos (Show other bugs)
Unspecified Unspecified
low Severity low
: rc
: ---
Assigned To: Bryn M. Reeves
David Kutálek
Depends On:
Blocks: 971420
  Show dependency treegraph
Reported: 2012-08-21 11:11 EDT by David Kutálek
Modified: 2013-06-06 09:10 EDT (History)
3 users (show)

See Also:
Fixed In Version: sos-2.2-32.el6
Doc Type: Bug Fix
Doc Text:
Cause: The python runtime's pipe communication interface adds an additional trailing newline ('\n') character to output read from an external program. Consequence: Files stored in the generated reports that are generated by running an external command include additional trailing whitespace that could interfere with attempts to compare file content. Fix: The sosreport command has been modified to remove this additional character when present. Result: File capture is now consistent between sos versions in Red Hat Enterprise Linux 5 and 6 simplifying comparison of diagnostic data captured on these two releases.
Story Points: ---
Clone Of:
: 971420 (view as bug list)
Last Closed: 2013-02-21 05:58:26 EST
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 David Kutálek 2012-08-21 11:11:51 EDT
Description of problem:

sosreport appends a new line char (\n) after gathered command shell output. While this seems like an intention, behaviour now differs for RHEL6 and RHEL5, where line is not appended. It seems to me we can remove this additional new line char in RHEL6

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

How reproducible:


Steps to Reproduce:
1. sosreport --batch -o general 
2. tar xf /tmp/sosreport-xxx.tar.xz
3. cat ./xxx/sos_commands/general/date 
4. date
Actual results:

Tue Aug 21 16:56:21 CEST 2012\n\n

Expected results:

Tue Aug 21 16:56:21 CEST 2012\n

Additional info:
Comment 1 Bryn M. Reeves 2012-10-17 10:18:04 EDT
This actually seems to be a python thing - we don't do anything to add the traling newline, it appears to just be a consequence of slurping the file up in pipe.communicate().

In RHEL5 we added a tweak to delete the last char if it is a '\n' (helpers.py::sosGetCommandOutput()). I'll do the same in 6 for consistency.
Comment 2 Bryn M. Reeves 2012-10-17 10:20:15 EDT
[root@rhel6-vm1 tmp]# cat rhel6-vm1-2012101715141350483291/sos_commands/general/date 
Wed Oct 17 15:14:56 BST 2012

[root@rhel6-vm1 tmp]#

[root@rhel6-vm1 tmp]# cat rhel6-vm1-2012101715171350483426/sos_commands/general/date 
Wed Oct 17 15:17:07 BST 2012
[root@rhel6-vm1 tmp]#
Comment 7 errata-xmlrpc 2013-02-21 05:58:26 EST
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.