Blame SOURCES/0046-docker-use-splitelines-for-command-output.patch

0cd6dc
From ce6cd3ae9dc89dd1de5122add016ce2df60b6cee Mon Sep 17 00:00:00 2001
0cd6dc
From: "Bryn M. Reeves" <bmr@redhat.com>
0cd6dc
Date: Mon, 19 Jan 2015 21:40:27 +0000
0cd6dc
Subject: [PATCH 46/93] [docker] use splitelines() for command output
0cd6dc
0cd6dc
Let's not reinvent splitlines(); the handrolled version docker
0cd6dc
was using fails to ignore the last newline:
0cd6dc
0cd6dc
[plugin:docker] collecting output of 'docker logs 9b8f61c09dba'
0cd6dc
[plugin:docker] collecting output of 'docker logs 6f46267c91d6'
0cd6dc
[plugin:docker] collecting output of 'docker logs '
0cd6dc
0cd6dc
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
0cd6dc
---
0cd6dc
 sos/plugins/docker.py | 3 +--
0cd6dc
 1 file changed, 1 insertion(+), 2 deletions(-)
0cd6dc
0cd6dc
diff --git a/sos/plugins/docker.py b/sos/plugins/docker.py
0cd6dc
index d8851a0..ef4ede0 100644
0cd6dc
--- a/sos/plugins/docker.py
0cd6dc
+++ b/sos/plugins/docker.py
0cd6dc
@@ -45,8 +45,7 @@ class Docker(Plugin):
0cd6dc
 
0cd6dc
         result = self.get_command_output(ps_cmd)
0cd6dc
         if result['status'] == 0:
0cd6dc
-            result['output'] = result['output'].split("\n")
0cd6dc
-            for line in result['output'][1:]:
0cd6dc
+            for line in result['output'].splitlines()[1:]:
0cd6dc
                 container_id = line.split(" ")[0]
0cd6dc
                 self.add_cmd_output([
0cd6dc
                     "{0} logs {1}".format(self.docker_bin, container_id)
0cd6dc
-- 
0cd6dc
1.9.3
0cd6dc