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

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