Blame SOURCES/sos-bz1843562-gluster-volume-specific.patch

c5258f
From fc831f0072c8f751f8fc2f46eb5c3e6aa9eba0a9 Mon Sep 17 00:00:00 2001
c5258f
From: Pavel Moravec <pmoravec@redhat.com>
c5258f
Date: Mon, 8 Jun 2020 14:58:15 +0200
c5258f
Subject: [PATCH] [gluster] fix gluster volume splitlines iteration
c5258f
c5258f
Iterate via "gluster volue info" output split to lines,
c5258f
and dont truncate the trailing character (a relict from past different
c5258f
content parsing).
c5258f
c5258f
Resolves: #2106
c5258f
c5258f
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
c5258f
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
c5258f
---
c5258f
 sos/plugins/gluster.py | 4 ++--
c5258f
 1 file changed, 2 insertions(+), 2 deletions(-)
c5258f
c5258f
diff --git a/sos/plugins/gluster.py b/sos/plugins/gluster.py
c5258f
index eb236f1e..9540d323 100644
c5258f
--- a/sos/plugins/gluster.py
c5258f
+++ b/sos/plugins/gluster.py
c5258f
@@ -104,10 +104,10 @@ class Gluster(Plugin, RedHatPlugin):
c5258f
 
c5258f
         volume_cmd = self.collect_cmd_output("gluster volume info")
c5258f
         if volume_cmd['status'] == 0:
c5258f
-            for line in volume_cmd['output']:
c5258f
+            for line in volume_cmd['output'].splitlines():
c5258f
                 if not line.startswith("Volume Name:"):
c5258f
                     continue
c5258f
-                volname = line[12:-1]
c5258f
+                volname = line[12:]
c5258f
                 self.add_cmd_output([
c5258f
                     "gluster volume get %s all" % volname,
c5258f
                     "gluster volume geo-replication %s status" % volname,
c5258f
-- 
c5258f
2.26.2
c5258f