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

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