diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2013-10-15 17:26:12 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2013-10-15 17:26:12 +0100 |
commit | 0ed431a385d238a0ee41770e6e0758ea722a9ee1 (patch) | |
tree | e9bce8168f2488bc614c8315075a9d373c914514 | |
parent | 13de2fed0e7a8e6257f92357965565430d001767 (diff) | |
download | sos-0ed431a385d238a0ee41770e6e0758ea722a9ee1.tar.gz |
Remove obsolete workaround for newline added by pipe.communicate()
Older versions of the python runtime would add a newline to output
obtained via pipe.communicate(). Current versions do not leading
to output being stored in reports without a trailing newline
character.
Remove the workaround to ensure that stored content matches that
obtained via simple shell redirection ("/some/command > file").
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/utilities.py | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/sos/utilities.py b/sos/utilities.py index 4279b12e..fcc78c54 100644 --- a/sos/utilities.py +++ b/sos/utilities.py @@ -161,8 +161,6 @@ def sos_get_command_output(command, timeout=300): stdout=PIPE, stderr=STDOUT, bufsize=-1, env = cmd_env) stdout, stderr = p.communicate() - # hack to delete trailing '\n' added by p.communicate() - if stdout[-1:] == '\n': stdout = stdout[:-1] return (p.returncode, stdout, 0) else: return (127, "", 0) |