import sos-4.1-4.el8

This commit is contained in:
CentOS Sources 2021-07-28 04:23:38 +00:00 committed by Andrew Lukoshko
parent 6890644d9b
commit a55890e289
4 changed files with 248 additions and 2 deletions

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

@ -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,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

@ -5,7 +5,7 @@
Summary: A set of tools to gather troubleshooting information from a system
Name: sos
Version: 4.1
Release: 3%{?dist}
Release: 4%{?dist}
Group: Applications/System
Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz
Source1: sos-audit-%{auditversion}.tgz
@ -37,6 +37,9 @@ Patch14: sos-bz1886711-enhance-tc-hw-offload.patch
Patch15: sos-bz1965001-fix-avc-copystating-proc-sys.patch
Patch16: sos-bz1967613-sssd-common.patch
Patch17: sos-bz1973675-ocp-cluster-cleaner.patch
Patch18: sos-bz1923938-sos-log-effective-options.patch
Patch19: sos-bz1985986-potential-issues-static-analyse.patch
Patch20: sos-bz1959598-conversions-and-upgrades.patch
%description
@ -65,6 +68,9 @@ support technicians and developers.
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%build
%py3_build
@ -80,12 +86,15 @@ cd %{name}-audit-%{auditversion}
DESTDIR=%{buildroot} ./install.sh
cd ..
mkdir -p %{buildroot}%{_sysconfdir}/sos/cleaner
mkdir -p %{buildroot}%{_sysconfdir}/sos/{cleaner,presets.d,extras.d,groups.d}
%files -f %{name}.lang
%{_sbindir}/sosreport
%{_sbindir}/sos
%{_sbindir}/sos-collector
%dir /etc/sos/presets.d
%dir /etc/sos/extras.d
%dir /etc/sos/groups.d
%{python3_sitelib}/*
%{_mandir}/man1/sosreport.1.gz
%{_mandir}/man1/sos-clean.1.gz
@ -128,6 +137,14 @@ of the system. Currently storage and filesystem commands are audited.
%ghost /etc/audit/rules.d/40-sos-storage.rules
%changelog
* Mon Jul 26 2021 Pavel Moravec <pmoravec@redhat.com> = 4.1-4
- [options] allow variant option names in config file
Resolves: bz1923938
- [plugins] Set default predicate instead of None
Resolves: bz1985986
- [MigrationResults] collect info about conversions
Resolves: bz1959598
* Mon Jun 21 2021 Pavel Moravec <pmoravec@redhat.com> = 4.1-3
- [gluster] collect public keys from the right dir
Resolves: bz1925419