Blame SOURCES/sos-bz1019338-remove-pipe-communicate-newline-workaround.patch

6b17e9
commit 25bd83cda4ef1a5c89d95282c9f8fdc6cb9181d5
6b17e9
Author: Bryn M. Reeves <bmr@redhat.com>
6b17e9
Date:   Tue Oct 15 17:26:12 2013 +0100
6b17e9
6b17e9
    Remove obsolete workaround for newline added by pipe.communicate()
6b17e9
    
6b17e9
    Older versions of the python runtime would add a newline to output
6b17e9
    obtained via pipe.communicate(). Current versions do not leading
6b17e9
    to output being stored in reports without a trailing newline
6b17e9
    character.
6b17e9
    
6b17e9
    Remove the workaround to ensure that stored content matches that
6b17e9
    obtained via simple shell redirection ("/some/command > file").
6b17e9
    
6b17e9
    Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
6b17e9
6b17e9
diff --git a/sos/utilities.py b/sos/utilities.py
6b17e9
index 4279b12..fcc78c5 100644
6b17e9
--- a/sos/utilities.py
6b17e9
+++ b/sos/utilities.py
6b17e9
@@ -161,8 +161,6 @@ def sos_get_command_output(command, timeout=300):
6b17e9
                 stdout=PIPE, stderr=STDOUT,
6b17e9
                 bufsize=-1, env = cmd_env)
6b17e9
         stdout, stderr = p.communicate()
6b17e9
-        # hack to delete trailing '\n' added by p.communicate()
6b17e9
-        if stdout[-1:] == '\n': stdout = stdout[:-1]
6b17e9
         return (p.returncode, stdout, 0)
6b17e9
     else:
6b17e9
         return (127, "", 0)