From af358988793beadb60ea863678d446e3d587ef44 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 12 2022 04:20:48 +0000 Subject: import sos-4.2-11.el8 --- diff --git a/SOURCES/sos-bz2036697-ocp-backports.patch b/SOURCES/sos-bz2036697-ocp-backports.patch index 0ab90be..81a582d 100644 --- a/SOURCES/sos-bz2036697-ocp-backports.patch +++ b/SOURCES/sos-bz2036697-ocp-backports.patch @@ -372,14 +372,13 @@ index 4b1ee109..f79bd5ff 100644 UnsupportedHostException) -@@ -60,35 +60,23 @@ class SosNode(): - 'presets': [], +@@ -61,34 +61,25 @@ class SosNode(): 'sos_cmd': commons['sos_cmd'] } -- self.sos_bin = 'sosreport' + self.sos_bin = 'sosreport' - filt = ['localhost', '127.0.0.1'] -- self.soslog = logging.getLogger('sos') -- self.ui_log = logging.getLogger('sos_ui') + self.soslog = logging.getLogger('sos') + self.ui_log = logging.getLogger('sos_ui') - self.control_path = ("%s/.sos-collector-%s" - % (self.tmpdir, self.address)) - self.ssh_cmd = self._create_ssh_command() @@ -5530,3 +5529,121 @@ index a25e794e1..ffd63bc63 100644 self.exit(msg, 1) if self.opts.upload and self.policy.get_upload_url(): +From 2c3a647817dfbac36be3768acf6026e91d1a6e8f Mon Sep 17 00:00:00 2001 +From: Jake Hunsaker +Date: Tue, 21 Dec 2021 14:20:19 -0500 +Subject: [PATCH] [options] Allow spaces in --keywords values in sos.conf + +The `--keywords` option supports spaces to allow for obfuscated phrases, +not just words. This however breaks if a phrase is added to the config +file *before* a run with the phrase in the cmdline option, due to the +safeguards we have for all other values that do not support spaces. + +Add a check in our flow for updating options from the config file to not +replace illegal spaces if we're checking the `keywords` option, for +which spaces are legal. + +Signed-off-by: Jake Hunsaker +--- + sos/options.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/sos/options.py b/sos/options.py +index 7bea3ffc1..4846a5096 100644 +--- a/sos/options.py ++++ b/sos/options.py +@@ -200,7 +200,10 @@ def _update_from_section(section, config): + odict[rename_opts[key]] = odict.pop(key) + # set the values according to the config file + for key, val in odict.items(): +- if isinstance(val, str): ++ # most option values do not tolerate spaces, special ++ # exception however for --keywords which we do want to ++ # support phrases, and thus spaces, for ++ if isinstance(val, str) and key != 'keywords': + val = val.replace(' ', '') + if key not in self.arg_defaults: + # read an option that is not loaded by the current +From f912fc9e31b406a24b7a9c012e12cda920632051 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Mon, 10 Jan 2022 14:13:42 +0100 +Subject: [PATCH] [collect] Deal None sos_version properly + +In case collector cluster hits an error during init, sos_version +is None what LooseVersion can't compare properly and raises exception + +'LooseVersion' object has no attribute 'version' + +Related: #2822 + +Signed-off-by: Pavel Moravec +--- + sos/collector/sosnode.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sos/collector/sosnode.py b/sos/collector/sosnode.py +index 925f27909..7bbe0cd1f 100644 +--- a/sos/collector/sosnode.py ++++ b/sos/collector/sosnode.py +@@ -382,7 +382,8 @@ def check_sos_version(self, ver): + given ver. This means that if the installed version is greater than + ver, this will still return True + """ +- return LooseVersion(self.sos_info['version']) >= ver ++ return self.sos_info['version'] is not None and \ ++ LooseVersion(self.sos_info['version']) >= ver + + def is_installed(self, pkg): + """Checks if a given package is installed on the node""" +From 0c67e8ebaeef17dac3b5b9e42a59b4e673e4403b Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Mon, 10 Jan 2022 14:17:13 +0100 +Subject: [PATCH] [collector] Cleanup cluster only if defined + +In case cluster init fails, self.cluster = None and its cleanup +must be skipped. + +Resolves: #2822 + +Signed-off-by: Pavel Moravec +--- + sos/collector/__init__.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/sos/collector/__init__.py b/sos/collector/__init__.py +index ffd63bc63..3e22bca3e 100644 +--- a/sos/collector/__init__.py ++++ b/sos/collector/__init__.py +@@ -443,7 +443,8 @@ def add_parser_options(cls, parser): + + def exit(self, msg, error=1): + """Used to safely terminate if sos-collector encounters an error""" +- self.cluster.cleanup() ++ if self.cluster: ++ self.cluster.cleanup() + self.log_error(msg) + try: + self.close_all_connections() +From ef27a6ee6737c23b3beda1437768a91679024697 Mon Sep 17 00:00:00 2001 +From: Nadia Pinaeva +Date: Fri, 3 Dec 2021 15:41:35 +0100 +Subject: [PATCH] Add journal logs for NetworkManager plugin + +Signed-off-by: Nadia Pinaeva +--- + sos/report/plugins/networkmanager.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sos/report/plugins/networkmanager.py b/sos/report/plugins/networkmanager.py +index 30f99a1140..3aca0c7460 100644 +--- a/sos/report/plugins/networkmanager.py ++++ b/sos/report/plugins/networkmanager.py +@@ -25,6 +25,8 @@ def setup(self): + "/etc/NetworkManager/dispatcher.d" + ]) + ++ self.add_journal(units="NetworkManager") ++ + # There are some incompatible changes in nmcli since + # the release of NetworkManager >= 0.9.9. In addition, + # NetworkManager >= 0.9.9 will use the long names of diff --git a/SPECS/sos.spec b/SPECS/sos.spec index 16b2f84..4981aa1 100644 --- a/SPECS/sos.spec +++ b/SPECS/sos.spec @@ -5,7 +5,7 @@ Summary: A set of tools to gather troubleshooting information from a system Name: sos Version: 4.2 -Release: 9%{?dist} +Release: 11%{?dist} Group: Applications/System Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz Source1: sos-audit-%{auditversion}.tgz @@ -134,6 +134,10 @@ of the system. Currently storage and filesystem commands are audited. %ghost /etc/audit/rules.d/40-sos-storage.rules %changelog +* Mon Jan 10 2022 Pavel Moravec = 4.2-11 +- [report] Add journal logs for NetworkManager plugin + Resolves: bz2036697 + * Fri Jan 07 2022 Pavel Moravec = 4.2-9 - add oc transport, backport various PRs for OCP Resolves: bz2036697