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

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