Blame SOURCES/sos-bz1719886-sos-conf-disabled-plugins-manpages.patch

ce36b2
From 4cb21e2c16b55e7506a3cefd9148ba4bf49dbce1 Mon Sep 17 00:00:00 2001
ce36b2
From: Pavel Moravec <pmoravec@redhat.com>
ce36b2
Date: Wed, 17 Apr 2019 13:17:24 +0200
ce36b2
Subject: [PATCH] [sosreport] update sos.conf manpages by [general] section
ce36b2
 description
ce36b2
ce36b2
Since PR #1530, sosreport supports all command line options. Man pages
ce36b2
should document the enhancement.
ce36b2
ce36b2
Resolves: #1652
ce36b2
ce36b2
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
ce36b2
---
ce36b2
 man/en/sos.conf.5 | 38 ++++++++++++++++++++++++++++++++++----
ce36b2
 1 file changed, 34 insertions(+), 4 deletions(-)
ce36b2
ce36b2
diff --git a/man/en/sos.conf.5 b/man/en/sos.conf.5
ce36b2
index b40a48e1..ad18d5f2 100644
ce36b2
--- a/man/en/sos.conf.5
ce36b2
+++ b/man/en/sos.conf.5
ce36b2
@@ -6,19 +6,49 @@ sos.conf \- sosreport configuration
ce36b2
 sosreport uses a configuration file at /etc/sos.conf.
ce36b2
 .SH PARAMETERS
ce36b2
 .sp
ce36b2
-There are two sections in the sosreport configuration file:
ce36b2
-plugins, and tunables. Options are set using 'ini'-style
ce36b2
-\fBname = value\fP pairs.
ce36b2
+There are three sections in the sosreport configuration file:
ce36b2
+general, plugins and tunables. Options are set using 'ini'-style
ce36b2
+\fBname = value\fP pairs. Disabling/enabling a boolean option
ce36b2
+is done the same way like on command line (e.g. process.lsof=off).
ce36b2
 
ce36b2
 Some options accept a comma separated list of values.
ce36b2
 
ce36b2
+Using options that dont expect a value (like all-logs or no-report)
ce36b2
+will result in enabling those options, regardless of value set.
ce36b2
+
ce36b2
+Sections are parsed in the ordering:
ce36b2
+.br
ce36b2
+- \fB[general]\fP
ce36b2
+.br
ce36b2
+- \fB[plugins]\fP (disable)
ce36b2
+.br
ce36b2
+- \fB[plugins]\fP (enable)
ce36b2
+.br
ce36b2
+- \fB[tunables]\fP
ce36b2
+
ce36b2
+.TP
ce36b2
+\fB[general]\fP
ce36b2
+<option>      Sets (long) option value. Short options (i.e. z=auto)
ce36b2
+              are not supported.
ce36b2
 .TP
ce36b2
 \fB[plugins]\fP
ce36b2
-disable Comma separated list of plugins to disable.
ce36b2
+disable       Comma separated list of plugins to disable.
ce36b2
+.br
ce36b2
+enable        Comma separated list of plugins to enable.
ce36b2
 .TP
ce36b2
 \fB[tunables]\fP
ce36b2
 plugin.option Alter available options for defined plugin.
ce36b2
 .SH EXAMPLES
ce36b2
+To use quiet and batch mode with 10 threads:
ce36b2
+.LP
ce36b2
+[general]
ce36b2
+.br
ce36b2
+batch=yes
ce36b2
+.br
ce36b2
+build=true
ce36b2
+.br
ce36b2
+threads=10
ce36b2
+.sp
ce36b2
 To disable the 'general' and 'filesys' plugins:
ce36b2
 .LP
ce36b2
 [plugins]
ce36b2
-- 
ce36b2
2.17.2
ce36b2
ce36b2
From 84822ff1bbe2d5543daa8059b0a2270c88e473d6 Mon Sep 17 00:00:00 2001
ce36b2
From: Pavel Moravec <pmoravec@redhat.com>
ce36b2
Date: Wed, 17 Apr 2019 11:51:09 +0200
ce36b2
Subject: [PATCH] [sosreport] initialize disabled plugins properly when parsing
ce36b2
 sos.conf
ce36b2
ce36b2
opts.noplugins is referred when parsing "tunables" section, so
ce36b2
the variable must be set to empty list every time.
ce36b2
ce36b2
Resolves: #1651
ce36b2
ce36b2
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
ce36b2
---
ce36b2
 sos/__init__.py | 2 +-
ce36b2
 1 file changed, 1 insertion(+), 1 deletion(-)
ce36b2
ce36b2
diff --git a/sos/__init__.py b/sos/__init__.py
ce36b2
index dfc7ed5f..ed59025a 100644
ce36b2
--- a/sos/__init__.py
ce36b2
+++ b/sos/__init__.py
ce36b2
@@ -250,8 +250,8 @@ class SoSOptions(object):
ce36b2
                 optlist.extend(SoSOptions._opt_to_args(opt, val))
ce36b2
             opts._merge_opts(argparser.parse_args(optlist), is_default)
ce36b2
 
ce36b2
+        opts.noplugins = []
ce36b2
         if config.has_option("plugins", "disable"):
ce36b2
-            opts.noplugins = []
ce36b2
             opts.noplugins.extend([plugin.strip() for plugin in
ce36b2
                                   config.get("plugins", "disable").split(',')])
ce36b2
 
ce36b2
-- 
ce36b2
2.17.2
ce36b2