aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2017-02-07 08:47:27 +0100
committerBryn M. Reeves <bmr@redhat.com>2017-02-21 12:13:44 +0000
commit701522333f3ccae8d04f698186597a418d15e8e9 (patch)
treea560dff23aa81a03508d38da2b4e86a004d5f49f
parentf8167a4426e7427fcbd687b82ab64f8632560e09 (diff)
downloadsos-701522333f3ccae8d04f698186597a418d15e8e9.tar.gz
[corosync] collect user defined logs from corosync.conf
corosync.conf often overwrites default log locations, let collect the user defined ones as well Resolves: #924. Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/corosync.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/sos/plugins/corosync.py b/sos/plugins/corosync.py
index dc227a77..ee8504ce 100644
--- a/sos/plugins/corosync.py
+++ b/sos/plugins/corosync.py
@@ -13,6 +13,7 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+import re
class Corosync(Plugin):
@@ -40,6 +41,17 @@ class Corosync(Plugin):
])
self.call_ext_prog("killall -USR2 corosync")
+ # collect user-defined logfiles, matching either of pattern:
+ # log_size: filename
+ # or
+ # logging.log_size: filename
+ # (it isnt precise but sufficient)
+ pattern = '^\s*(logging.)?logfile:\s*(\S+)$'
+ with open("/etc/corosync/corosync.conf") as f:
+ for line in f:
+ if re.match(pattern, line):
+ self.add_copy_spec(re.search(pattern, line).group(2))
+
def postproc(self):
self.do_cmd_output_sub(
"corosync-objctl",