Blob Blame History Raw
From 4cb21e2c16b55e7506a3cefd9148ba4bf49dbce1 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Wed, 17 Apr 2019 13:17:24 +0200
Subject: [PATCH] [sosreport] update sos.conf manpages by [general] section
 description

Since PR #1530, sosreport supports all command line options. Man pages
should document the enhancement.

Resolves: #1652

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
 man/en/sos.conf.5 | 38 ++++++++++++++++++++++++++++++++++----
 1 file changed, 34 insertions(+), 4 deletions(-)

diff --git a/man/en/sos.conf.5 b/man/en/sos.conf.5
index b40a48e1..ad18d5f2 100644
--- a/man/en/sos.conf.5
+++ b/man/en/sos.conf.5
@@ -6,19 +6,49 @@ sos.conf \- sosreport configuration
 sosreport uses a configuration file at /etc/sos.conf.
 .SH PARAMETERS
 .sp
-There are two sections in the sosreport configuration file:
-plugins, and tunables. Options are set using 'ini'-style
-\fBname = value\fP pairs.
+There are three sections in the sosreport configuration file:
+general, plugins and tunables. Options are set using 'ini'-style
+\fBname = value\fP pairs. Disabling/enabling a boolean option
+is done the same way like on command line (e.g. process.lsof=off).
 
 Some options accept a comma separated list of values.
 
+Using options that dont expect a value (like all-logs or no-report)
+will result in enabling those options, regardless of value set.
+
+Sections are parsed in the ordering:
+.br
+- \fB[general]\fP
+.br
+- \fB[plugins]\fP (disable)
+.br
+- \fB[plugins]\fP (enable)
+.br
+- \fB[tunables]\fP
+
+.TP
+\fB[general]\fP
+<option>      Sets (long) option value. Short options (i.e. z=auto)
+              are not supported.
 .TP
 \fB[plugins]\fP
-disable Comma separated list of plugins to disable.
+disable       Comma separated list of plugins to disable.
+.br
+enable        Comma separated list of plugins to enable.
 .TP
 \fB[tunables]\fP
 plugin.option Alter available options for defined plugin.
 .SH EXAMPLES
+To use quiet and batch mode with 10 threads:
+.LP
+[general]
+.br
+batch=yes
+.br
+build=true
+.br
+threads=10
+.sp
 To disable the 'general' and 'filesys' plugins:
 .LP
 [plugins]
-- 
2.17.2

From 84822ff1bbe2d5543daa8059b0a2270c88e473d6 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Wed, 17 Apr 2019 11:51:09 +0200
Subject: [PATCH] [sosreport] initialize disabled plugins properly when parsing
 sos.conf

opts.noplugins is referred when parsing "tunables" section, so
the variable must be set to empty list every time.

Resolves: #1651

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
 sos/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sos/__init__.py b/sos/__init__.py
index dfc7ed5f..ed59025a 100644
--- a/sos/__init__.py
+++ b/sos/__init__.py
@@ -250,8 +250,8 @@ class SoSOptions(object):
                 optlist.extend(SoSOptions._opt_to_args(opt, val))
             opts._merge_opts(argparser.parse_args(optlist), is_default)
 
+        opts.noplugins = []
         if config.has_option("plugins", "disable"):
-            opts.noplugins = []
             opts.noplugins.extend([plugin.strip() for plugin in
                                   config.get("plugins", "disable").split(',')])
 
-- 
2.17.2