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