|
|
9ab0e5 |
From 61a638ba60b30408735e4f65dcfdf7aa6b420449 Mon Sep 17 00:00:00 2001
|
|
|
9ab0e5 |
From: Jan Jansky <jjansky@redhat.com>
|
|
|
9ab0e5 |
Date: Wed, 15 Jul 2020 15:58:58 +0200
|
|
|
9ab0e5 |
Subject: [PATCH] [gluster] remove only dump files
|
|
|
9ab0e5 |
|
|
|
9ab0e5 |
Removes only dump files and leaving
|
|
|
9ab0e5 |
other files as .socket or sock.
|
|
|
9ab0e5 |
|
|
|
9ab0e5 |
Related: #2152
|
|
|
9ab0e5 |
Resolves: #2153
|
|
|
9ab0e5 |
|
|
|
9ab0e5 |
Signed-off-by: Jan Jansky <jjansky@redhat.com>
|
|
|
9ab0e5 |
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
9ab0e5 |
---
|
|
|
9ab0e5 |
sos/plugins/gluster.py | 17 ++++++++---------
|
|
|
9ab0e5 |
1 file changed, 8 insertions(+), 9 deletions(-)
|
|
|
9ab0e5 |
|
|
|
9ab0e5 |
diff --git a/sos/plugins/gluster.py b/sos/plugins/gluster.py
|
|
|
9ab0e5 |
index a5b0458..777f941 100644
|
|
|
9ab0e5 |
--- a/sos/plugins/gluster.py
|
|
|
9ab0e5 |
+++ b/sos/plugins/gluster.py
|
|
|
9ab0e5 |
@@ -40,15 +40,14 @@ class Gluster(Plugin, RedHatPlugin):
|
|
|
9ab0e5 |
ret = string.count(last_line, 'DUMP_END_TIME')
|
|
|
9ab0e5 |
|
|
|
9ab0e5 |
def postproc(self):
|
|
|
9ab0e5 |
- if not os.path.exists(self.statedump_dir):
|
|
|
9ab0e5 |
- return
|
|
|
9ab0e5 |
- try:
|
|
|
9ab0e5 |
- for dirs in os.listdir(self.statedump_dir):
|
|
|
9ab0e5 |
- os.remove(os.path.join(self.statedump_dir, dirs))
|
|
|
9ab0e5 |
- os.rmdir(self.statedump_dir)
|
|
|
9ab0e5 |
- os.unlink('/tmp/glusterdump.options')
|
|
|
9ab0e5 |
- except OSError:
|
|
|
9ab0e5 |
- pass
|
|
|
9ab0e5 |
+ if self.get_option("dump"):
|
|
|
9ab0e5 |
+ if not os.path.exists(self.statedump_dir):
|
|
|
9ab0e5 |
+ return
|
|
|
9ab0e5 |
+ try:
|
|
|
9ab0e5 |
+ for name in glob.glob(self.statedump_dir + '/*.dump.[0-9]*'):
|
|
|
9ab0e5 |
+ os.remove(name)
|
|
|
9ab0e5 |
+ except OSError:
|
|
|
9ab0e5 |
+ pass
|
|
|
9ab0e5 |
|
|
|
9ab0e5 |
def setup(self):
|
|
|
9ab0e5 |
self.add_forbidden_path("/var/lib/glusterd/geo-replication/secret.pem")
|
|
|
9ab0e5 |
--
|
|
|
9ab0e5 |
1.8.3.1
|
|
|
9ab0e5 |
|