sos updates to RHEL 9.0 Beta

- making 9.0 Beta in par with 8.5
- adding fixes of 1985985 & 1938874 & to both 8.5/9.0beta

Resolves: bz1938874 bz1959779 bz1967718 bz1985976 bz1985982
Resolves: bz1985983 bz1985985

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
This commit is contained in:
Pavel Moravec 2021-07-27 11:00:18 +02:00
parent b4196a346f
commit a9c4b4aaf7
8 changed files with 2562 additions and 1 deletions

View File

@ -0,0 +1,65 @@
From 6d5cbe90e17534d53d7fe42dff4d8ca734acf594 Mon Sep 17 00:00:00 2001
From: Jake Hunsaker <jhunsake@redhat.com>
Date: Tue, 29 Jun 2021 15:49:00 -0400
Subject: [PATCH] [yum] Fix potential traceback when yum history is empty
Like we did in #969 for `dnf`, fix a potential issue where we would
generate a traceback in the plugin when `yum history` is empty.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
sos/report/plugins/yum.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sos/report/plugins/yum.py b/sos/report/plugins/yum.py
index 54e222df..aec805e6 100644
--- a/sos/report/plugins/yum.py
+++ b/sos/report/plugins/yum.py
@@ -91,7 +91,7 @@ class Yum(Plugin, RedHatPlugin):
# packages installed/erased/updated per transaction
if self.get_option("yum-history-info"):
history = self.exec_cmd("yum history")
- transactions = None
+ transactions = -1
if history['status'] == 0:
for line in history['output'].splitlines():
try:
--
2.31.1
From a7a4ef73faee6cddba36bf670d4a20ab0521c36f Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Wed, 30 Jun 2021 13:10:56 +0200
Subject: [PATCH] [plugins] Set default predicate instead of None for
robustness
Just making the code more robustness, it could be dangerous to
set pred = None and then potentially call log_skipped_cmd that
expects "pred" of SoSPredicate type.
Currently such a call flow can not happen, but it is worth to
make the code more robust for potential future changes.
Resolves: #2601
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
sos/report/plugins/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py
index 6fd1a3b2..b9cd28ed 100644
--- a/sos/report/plugins/__init__.py
+++ b/sos/report/plugins/__init__.py
@@ -1629,7 +1629,7 @@ class Plugin(object):
def _add_cmd_output(self, **kwargs):
"""Internal helper to add a single command to the collection list."""
- pred = kwargs.pop('pred') if 'pred' in kwargs else None
+ pred = kwargs.pop('pred') if 'pred' in kwargs else SoSPredicate(self)
soscmd = SoSCommand(**kwargs)
self._log_debug("packed command: " + soscmd.__str__())
for _skip_cmd in self.skip_commands:
--
2.31.1

View File

@ -0,0 +1,50 @@
From ee5d9d017b0a1bfeaebee9c21c17e89ef1f909a8 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Mon, 26 Jul 2021 13:30:09 +0200
Subject: [PATCH] [MigrationResults] collect info about conversions and
upgrades
A new tiny plugin independent on leapp and convert2rhel is proposed.
It should collect /etc/migration-results with info about RHEL
conversions and upgrades, whenever the file is present.
Resolves: #2627
Relevant to: rhbz#1959598
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
sos/report/plugins/migration_results.py | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 sos/report/plugins/migration_results.py
diff --git a/sos/report/plugins/migration_results.py b/sos/report/plugins/migration_results.py
new file mode 100644
index 00000000..b67480ba
--- /dev/null
+++ b/sos/report/plugins/migration_results.py
@@ -0,0 +1,21 @@
+# This file is part of the sos project: https://github.com/sosreport/sos
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions of
+# version 2 of the GNU General Public License.
+#
+# See the LICENSE file in the source distribution for further information.
+
+from sos.report.plugins import Plugin, RedHatPlugin
+
+
+class MigrationResults(Plugin, RedHatPlugin):
+
+ short_desc = 'Information about conversions and upgrades'
+
+ plugin_name = 'migration_results'
+ profiles = ('system',)
+
+ files = ('/etc/migration-results',)
+
+# vim: et ts=4 sw=4
--
2.31.1

View File

@ -0,0 +1,36 @@
From 630dfbee936050698d33b59abd1e243c44e50af8 Mon Sep 17 00:00:00 2001
From: Jan Jansky <jjansky@redhat.com>
Date: Thu, 3 Jun 2021 15:04:57 +0200
Subject: [PATCH] [sssd] sssd plugin when sssd-common
We have reports that sssd logs are not
collected, when we investigated
we found associate wants to collect
sssd related logs also when only
sssd-common package is installed.
We got this confirmed by sbr-idm.
Resolves: #2571
Signed-off-by: Jan Jansky <jjansky@redhat.com>
---
sos/report/plugins/sssd.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sos/report/plugins/sssd.py b/sos/report/plugins/sssd.py
index 17933935..6f98e90c 100644
--- a/sos/report/plugins/sssd.py
+++ b/sos/report/plugins/sssd.py
@@ -19,7 +19,7 @@ class Sssd(Plugin):
plugin_name = "sssd"
profiles = ('services', 'security', 'identity')
- packages = ('sssd',)
+ packages = ('sssd', 'sssd-common')
def setup(self):
self.add_copy_spec([
--
2.26.3

View File

@ -0,0 +1,32 @@
From bbb7f8bf522960a8ca7625f539e9e5d109abb704 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Wed, 19 May 2021 08:31:45 +0200
Subject: [PATCH] [networking] collect also tc filter show ingress
Both "tc -s filter show dev %eth [|ingress]" commands required as
they provide different output.
Resolves: #2550
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
sos/report/plugins/networking.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sos/report/plugins/networking.py b/sos/report/plugins/networking.py
index acfa027f..35646268 100644
--- a/sos/report/plugins/networking.py
+++ b/sos/report/plugins/networking.py
@@ -156,7 +156,8 @@ class Networking(Plugin):
"ethtool --phy-statistics " + eth,
"ethtool --show-priv-flags " + eth,
"ethtool --show-eee " + eth,
- "tc -s filter show dev " + eth
+ "tc -s filter show dev " + eth,
+ "tc -s filter show dev " + eth + " ingress",
], tags=eth)
# skip EEPROM collection by default, as it might hang or
--
2.26.3

View File

@ -0,0 +1,78 @@
From b27140a9126ea82efb517d60bf1b8455aaf4f5a6 Mon Sep 17 00:00:00 2001
From: Jake Hunsaker <jhunsake@redhat.com>
Date: Fri, 26 Mar 2021 11:12:33 -0400
Subject: [PATCH] [cleaner] Only skip packaging-based files for the IP parser
Files primarily containing package information, e.g. `installed-rpms` or
`installed-debs`, were previously being skipped by all parsers. In
reality, we only need to skip these for the IP parser due to the fact
that version numbers often generate a match for IP address regexes.
This will also fix a problem where if a system was the build host for
certain packages, the hostname would remain in these files as the
hostname parser was previously not checking these files.
Closes: #2400
Resolves: #2464
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
sos/cleaner/obfuscation_archive.py | 10 ----------
sos/cleaner/parsers/ip_parser.py | 16 ++++++++++++++++
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/sos/cleaner/obfuscation_archive.py b/sos/cleaner/obfuscation_archive.py
index 981cc05f..84ca30cd 100644
--- a/sos/cleaner/obfuscation_archive.py
+++ b/sos/cleaner/obfuscation_archive.py
@@ -59,20 +59,10 @@ class SoSObfuscationArchive():
Returns: list of files and file regexes
"""
return [
- 'installed-debs',
- 'installed-rpms',
- 'sos_commands/dpkg',
- 'sos_commands/python/pip_list',
- 'sos_commands/rpm',
- 'sos_commands/yum/.*list.*',
- 'sos_commands/snappy/snap_list_--all',
- 'sos_commands/snappy/snap_--version',
- 'sos_commands/vulkan/vulkaninfo',
'sys/firmware',
'sys/fs',
'sys/kernel/debug',
'sys/module',
- 'var/log/.*dnf.*',
r'.*\.tar$', # TODO: support archive unpacking
# Be explicit with these tar matches to avoid matching commands
r'.*\.tar\.xz',
diff --git a/sos/cleaner/parsers/ip_parser.py b/sos/cleaner/parsers/ip_parser.py
index 3ea7f865..08d1cd05 100644
--- a/sos/cleaner/parsers/ip_parser.py
+++ b/sos/cleaner/parsers/ip_parser.py
@@ -24,6 +24,22 @@ class SoSIPParser(SoSCleanerParser):
# don't match package versions recorded in journals
r'.*dnf\[.*\]:'
]
+
+ skip_files = [
+ # skip these as version numbers will frequently look like IP addresses
+ # when using regex matching
+ 'installed-debs',
+ 'installed-rpms',
+ 'sos_commands/dpkg',
+ 'sos_commands/python/pip_list',
+ 'sos_commands/rpm',
+ 'sos_commands/yum/.*list.*',
+ 'sos_commands/snappy/snap_list_--all',
+ 'sos_commands/snappy/snap_--version',
+ 'sos_commands/vulkan/vulkaninfo',
+ 'var/log/.*dnf.*'
+ ]
+
map_file_key = 'ip_map'
prep_map_file = 'sos_commands/networking/ip_-o_addr'
--
2.26.3

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,114 @@
From 00d12ad3cf24dcc6c73e9bcf63db1d3f17e58bb1 Mon Sep 17 00:00:00 2001
From: Jake Hunsaker <jhunsake@redhat.com>
Date: Thu, 1 Jul 2021 10:50:54 -0400
Subject: [PATCH] [sosnode] Properly format skip-commands and skip-files on
nodes
Fixes an issue where options provided for `skip-commands` and
`skip-files` were not properly formatted, thus causing an exception
during the finalization of the node's sos command.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
---
sos/collector/sosnode.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sos/collector/sosnode.py b/sos/collector/sosnode.py
index 6597d236..426edcba 100644
--- a/sos/collector/sosnode.py
+++ b/sos/collector/sosnode.py
@@ -734,11 +734,12 @@ class SosNode():
if self.check_sos_version('4.1'):
if self.opts.skip_commands:
sos_opts.append(
- '--skip-commands=%s' % (quote(self.opts.skip_commands))
+ '--skip-commands=%s' % (
+ quote(','.join(self.opts.skip_commands)))
)
if self.opts.skip_files:
sos_opts.append(
- '--skip-files=%s' % (quote(self.opts.skip_files))
+ '--skip-files=%s' % (quote(','.join(self.opts.skip_files)))
)
if self.check_sos_version('4.2'):
--
2.31.1
From de7edce3f92ed50abcb28dd0dbcbeb104dc7c679 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Fri, 2 Jul 2021 09:52:11 +0200
Subject: [PATCH] [collector] fix a typo in --plugin-option
Sos report uses --plugin-option or --plugopts.
Relevant: #2606
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
sos/collector/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sos/collector/__init__.py b/sos/collector/__init__.py
index 6d96d692..f072287e 100644
--- a/sos/collector/__init__.py
+++ b/sos/collector/__init__.py
@@ -272,7 +272,7 @@ class SoSCollector(SoSComponent):
help="chroot executed commands to SYSROOT")
sos_grp.add_argument('-e', '--enable-plugins', action="extend",
help='Enable specific plugins for sosreport')
- sos_grp.add_argument('-k', '--plugin-options', action="extend",
+ sos_grp.add_argument('-k', '--plugin-option', action="extend",
help='Plugin option as plugname.option=value')
sos_grp.add_argument('--log-size', default=0, type=int,
help='Limit the size of individual logs (in MiB)')
--
2.31.1
From 24a79ae8df8f29276f6139c68d4ba9b05114f951 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Fri, 2 Jul 2021 09:53:47 +0200
Subject: [PATCH] [options] allow variant option names in config file
While cmdline allows --plugin-option as well as --plugopts,
it stores the value under `plugopts` key. Therefore parsing
config file ignores --plugin-option.
Similarly for --name/--label and --profile/--profiles.
When processing config file, we must unify those potentially duplicit
keys.
Resolves: #2606
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
---
sos/options.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sos/options.py b/sos/options.py
index 1eda55d6..a014a022 100644
--- a/sos/options.py
+++ b/sos/options.py
@@ -186,9 +186,18 @@ class SoSOptions():
if 'verbose' in odict.keys():
odict['verbosity'] = int(odict.pop('verbose'))
# convert options names
+ # unify some of them if multiple variants of the
+ # cmdoption exist
+ rename_opts = {
+ 'name': 'label',
+ 'plugin_option': 'plugopts',
+ 'profile': 'profiles'
+ }
for key in list(odict):
if '-' in key:
odict[key.replace('-', '_')] = odict.pop(key)
+ if key in rename_opts:
+ 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):
--
2.31.1

View File

@ -5,7 +5,7 @@
Summary: A set of tools to gather troubleshooting information from a system Summary: A set of tools to gather troubleshooting information from a system
Name: sos Name: sos
Version: 4.1 Version: 4.1
Release: 5%{?dist} Release: 6%{?dist}
Group: Applications/System Group: Applications/System
Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz
Source1: sos-audit-%{auditversion}.tgz Source1: sos-audit-%{auditversion}.tgz
@ -35,6 +35,13 @@ Patch10: sos-bz1967118-saphana-traceback.patch
Patch11: sos-bz1967119-collect-nstat.patch Patch11: sos-bz1967119-collect-nstat.patch
Patch12: sos-bz1967120-snapper-plugin-and-allocation-failures.patch Patch12: sos-bz1967120-snapper-plugin-and-allocation-failures.patch
Patch13: sos-bz1965002-skip-selinux-of-proc-everytime.patch Patch13: sos-bz1965002-skip-selinux-of-proc-everytime.patch
Patch14: sos-bz1985976-enhance-tc-hw-offload.patch
Patch15: sos-bz1985982-obfuscate-fqdn-from-dnf-log.patch
Patch16: sos-bz1967718-sssd-common.patch
Patch17: sos-bz1985983-ocp-cluster-cleaner.patch
Patch18: sos-bz1985985-sos-log-effective-options.patch
Patch19: sos-bz1938874-potential-issues-static-analyse.patch
Patch20: sos-bz1959779-conversions-and-upgrades.patch
%description %description
Sos is a set of tools that gathers information about system Sos is a set of tools that gathers information about system
@ -58,6 +65,13 @@ support technicians and developers.
%patch11 -p1 %patch11 -p1
%patch12 -p1 %patch12 -p1
%patch13 -p1 %patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%build %build
%py3_build %py3_build
@ -125,6 +139,22 @@ of the system. Currently storage and filesystem commands are audited.
%changelog %changelog
* Tue Jul 27 2021 Pavel Moravec <pmoravec@redhat.com> - 4.1-6
- [networking] collect also tc filter show ingress
Resolves: bz1985976
- [cleaner] Only skip packaging-based files for the IP parser
Resolves: bz1985982
- [sssd] sssd plugin when sssd-common
Resolves: bz1967718
- Various OCP/cluster/cleanup enhancements
Resolves: bz1985983
- [options] allow variant option names in config file
Resolves: bz1985985
- [plugins] Set default predicate instead of None
Resolves: bz1938874
- [MigrationResults] collect info about conversions and
Resolves: bz1959779
* Wed Jun 02 2021 Pavel Moravec <pmoravec@redhat.com> - 4.1-4 * Wed Jun 02 2021 Pavel Moravec <pmoravec@redhat.com> - 4.1-4
- [archive] skip copying SELinux context for /proc and /sys everytime - [archive] skip copying SELinux context for /proc and /sys everytime
Resolves: bz1965002 Resolves: bz1965002