Blob Blame History Raw
From b5389aa195675f473acdd22f20017a8854ff82d0 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Wed, 16 Feb 2022 08:43:32 +0100
Subject: [PATCH] [man] Mention sos-help in main sos manpage

Related to #2860

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
 man/en/sos.1 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/man/en/sos.1 b/man/en/sos.1
index ce4918f99..c335b7e10 100644
--- a/man/en/sos.1
+++ b/man/en/sos.1
@@ -67,6 +67,14 @@ May be invoked via either \fBsos clean\fR, \fBsos cleaner\fR, \fBsos mask\fR,
 or via the \fB--clean\fR, \fB--cleaner\fR or \fB --mask\fR options
 for \fBreport\fR and \fBcollect\fR.
 
+.TP
+.B help
+This subcommand is used to retrieve more detailed information on the various SoS
+commands and components than is directly available in either other manpages or
+--help output.
+
+See \fB sos help --help\fR and \fB man sos-help\fR for more information.
+
 .SH GLOBAL OPTIONS
 sos components provide their own set of options, however the following are available
 to be set across all components.
From ac4eb48fa35c13b99ada41540831412480babf8d Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Wed, 16 Feb 2022 08:44:16 +0100
Subject: [PATCH] [setup] Add sos-help to build process

Resolves: #2860
Closes: #2861

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
 setup.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index 25e87a71b..8db8641f0 100644
--- a/setup.py
+++ b/setup.py
@@ -90,7 +90,7 @@ def copy_file (self, filename, dirname):
         ('share/man/man1', ['man/en/sosreport.1', 'man/en/sos-report.1',
                             'man/en/sos.1', 'man/en/sos-collect.1',
                             'man/en/sos-collector.1', 'man/en/sos-clean.1',
-                            'man/en/sos-mask.1']),
+                            'man/en/sos-mask.1', 'man/en/sos-help.1']),
         ('share/man/man5', ['man/en/sos.conf.5']),
         ('share/licenses/sos', ['LICENSE']),
         ('share/doc/sos', ['AUTHORS', 'README.md']),
@@ -102,7 +102,8 @@ def copy_file (self, filename, dirname):
         'sos.policies.package_managers', 'sos.policies.init_systems',
         'sos.report', 'sos.report.plugins', 'sos.collector',
         'sos.collector.clusters', 'sos.collector.transports', 'sos.cleaner',
-        'sos.cleaner.mappings', 'sos.cleaner.parsers', 'sos.cleaner.archives'
+        'sos.cleaner.mappings', 'sos.cleaner.parsers', 'sos.cleaner.archives',
+        'sos.help'
     ],
     cmdclass=cmdclass,
     command_options=command_options,
From de9b020a72d1ceda39587db4c6d5acf72cd90da2 Mon Sep 17 00:00:00 2001
From: Fernando Royo <froyo@redhat.com>
Date: Tue, 15 Feb 2022 10:00:38 +0100
Subject: [PATCH] [ovn_central] Rename container responsable of Red Hat
 ovn_central plugin

ovn_central plugin is running by container with
name 'ovn-dbs-bundle*', a typo has been identified and
this cause plugin ovn_central not enabled by default as it
does not recognize any container responsible of this.

This patch fix this container name match, searching schema db
keeping backward compatibility with openvswitch.
---
 sos/report/plugins/ovn_central.py | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/sos/report/plugins/ovn_central.py b/sos/report/plugins/ovn_central.py
index 2f0438df3..2f34bff09 100644
--- a/sos/report/plugins/ovn_central.py
+++ b/sos/report/plugins/ovn_central.py
@@ -24,7 +24,7 @@ class OVNCentral(Plugin):
     short_desc = 'OVN Northd'
     plugin_name = "ovn_central"
     profiles = ('network', 'virt')
-    containers = ('ovs-db-bundle.*',)
+    containers = ('ovn-dbs-bundle.*',)
 
     def get_tables_from_schema(self, filename, skip=[]):
         if self._container_name:
@@ -66,7 +66,7 @@ def add_database_output(self, tables, cmds, ovn_cmd):
             cmds.append('%s list %s' % (ovn_cmd, table))
 
     def setup(self):
-        self._container_name = self.get_container_by_name('ovs-dbs-bundle.*')
+        self._container_name = self.get_container_by_name(self.containers[0])
 
         ovs_rundir = os.environ.get('OVS_RUNDIR')
         for pidfile in ['ovnnb_db.pid', 'ovnsb_db.pid', 'ovn-northd.pid']:
@@ -110,12 +110,11 @@ def setup(self):
             'ovn-sbctl get-connection',
         ]
 
-        schema_dir = '/usr/share/openvswitch'
-
-        nb_tables = self.get_tables_from_schema(self.path_join(
-            schema_dir, 'ovn-nb.ovsschema'))
-
-        self.add_database_output(nb_tables, nbctl_cmds, 'ovn-nbctl')
+        # backward compatibility
+        for path in ['/usr/share/openvswitch', '/usr/share/ovn']:
+            nb_tables = self.get_tables_from_schema(self.path_join(
+                path, 'ovn-nb.ovsschema'))
+            self.add_database_output(nb_tables, nbctl_cmds, 'ovn-nbctl')
 
         cmds = ovsdb_cmds
         cmds += nbctl_cmds
@@ -125,9 +124,11 @@ def setup(self):
               format(self.ovn_sbdb_sock_path),
               "output": "Leader: self"}
         if self.test_predicate(self, pred=SoSPredicate(self, cmd_outputs=co)):
-            sb_tables = self.get_tables_from_schema(self.path_join(
-                schema_dir, 'ovn-sb.ovsschema'), ['Logical_Flow'])
-            self.add_database_output(sb_tables, sbctl_cmds, 'ovn-sbctl')
+            # backward compatibility
+            for path in ['/usr/share/openvswitch', '/usr/share/ovn']:
+                sb_tables = self.get_tables_from_schema(self.path_join(
+                    path, 'ovn-sb.ovsschema'), ['Logical_Flow'])
+                self.add_database_output(sb_tables, sbctl_cmds, 'ovn-sbctl')
             cmds += sbctl_cmds
 
         # If OVN is containerized, we need to run the above commands inside
From 7ebb2ce0bcd13c1b3aada648aceb20b5aff636d9 Mon Sep 17 00:00:00 2001
From: Jake Hunsaker <jhunsake@redhat.com>
Date: Tue, 15 Feb 2022 14:18:02 -0500
Subject: [PATCH] [host] Skip entire /etc/sos/cleaner directory

While `default_mapping` is typically the only file expected under
`/etc/sos/cleaner/` it is possible for other mapping files (such as
backups) to appear there.

Make the `add_forbidden_path()` spec here target the entire cleaner
directory to avoid ever capturing these map files.

Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
 sos/report/plugins/host.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sos/report/plugins/host.py b/sos/report/plugins/host.py
index 5e21da7b8..95a3b9cd9 100644
--- a/sos/report/plugins/host.py
+++ b/sos/report/plugins/host.py
@@ -20,7 +20,7 @@ class Host(Plugin, IndependentPlugin):
 
     def setup(self):
 
-        self.add_forbidden_path('/etc/sos/cleaner/default_mapping')
+        self.add_forbidden_path('/etc/sos/cleaner')
 
         self.add_cmd_output('hostname', root_symlink='hostname')
         self.add_cmd_output('uptime', root_symlink='uptime')