import sos-4.2-11.el8

This commit is contained in:
CentOS Sources 2022-01-12 04:20:48 +00:00 committed by Stepan Oksanichenko
parent 76b3bf6a40
commit 58256ec7c2
2 changed files with 127 additions and 6 deletions

View File

@ -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 <jhunsake@redhat.com>
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 <jhunsake@redhat.com>
---
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 <pmoravec@redhat.com>
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 <pmoravec@redhat.com>
---
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 <pmoravec@redhat.com>
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 <pmoravec@redhat.com>
---
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 <npinaeva@redhat.com>
Date: Fri, 3 Dec 2021 15:41:35 +0100
Subject: [PATCH] Add journal logs for NetworkManager plugin
Signed-off-by: Nadia Pinaeva <npinaeva@redhat.com>
---
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

View File

@ -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 <pmoravec@redhat.com> = 4.2-11
- [report] Add journal logs for NetworkManager plugin
Resolves: bz2036697
* Fri Jan 07 2022 Pavel Moravec <pmoravec@redhat.com> = 4.2-9
- add oc transport, backport various PRs for OCP
Resolves: bz2036697