From f2c8211810b98c207e2e5ce3bff26304c945fcae Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jan 05 2021 10:08:17 +0000 Subject: import sos-4.0-4.el8 --- diff --git a/SOURCES/sos-bz1848095-collect-rhev-pki.patch b/SOURCES/sos-bz1848095-collect-rhev-pki.patch new file mode 100644 index 0000000..959f58c --- /dev/null +++ b/SOURCES/sos-bz1848095-collect-rhev-pki.patch @@ -0,0 +1,42 @@ +From bbd28011f8bb710d64283bd6d3ec68c0fb5430b4 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Fri, 6 Nov 2020 21:28:37 +0100 +Subject: [PATCH] [ovirt] collect /etc/pki/ovirt-engine/.truststore + +.truststore contains useful public CAs but a_c_s skips collecting +that hidden file. + +Closes: #2296 +Resolves: #2297 + +Signed-off-by: Pavel Moravec +Signed-off-by: Jake Hunsaker +--- + sos/report/plugins/ovirt.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/sos/report/plugins/ovirt.py b/sos/report/plugins/ovirt.py +index 4c112cac..127c971c 100644 +--- a/sos/report/plugins/ovirt.py ++++ b/sos/report/plugins/ovirt.py +@@ -137,12 +137,15 @@ class Ovirt(Plugin, RedHatPlugin): + "/var/lib/ovirt-engine-reports/jboss_runtime/config" + ]) + +- # Copying host certs. ++ # Copying host certs; extra copy the hidden .truststore file + self.add_forbidden_path([ + "/etc/pki/ovirt-engine/keys", + "/etc/pki/ovirt-engine/private" + ]) +- self.add_copy_spec("/etc/pki/ovirt-engine/") ++ self.add_copy_spec([ ++ "/etc/pki/ovirt-engine/", ++ "/etc/pki/ovirt-engine/.truststore", ++ ]) + + def postproc(self): + """ +-- +2.26.2 + diff --git a/SOURCES/sos-bz1881118-crio-conf-d.patch b/SOURCES/sos-bz1881118-crio-conf-d.patch index 905a00b..d39b353 100644 --- a/SOURCES/sos-bz1881118-crio-conf-d.patch +++ b/SOURCES/sos-bz1881118-crio-conf-d.patch @@ -28,3 +28,43 @@ index dacc0745..e8b566c3 100644 -- 2.26.2 +From 7f72a36144b3e235159556689b5129b7453294e3 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Tue, 15 Dec 2020 14:19:34 +0100 +Subject: [PATCH] [component] Use sysroot from Policy when opts doesn't specify + it + +Until --sysroot option is specified, Archive (sub)classes should +be called with sysroot determined from Policy. + +Resolves: #2346 + +Signed-off-by: Pavel Moravec +Signed-off-by: Jake Hunsaker +--- + sos/component.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sos/component.py b/sos/component.py +index 69d3b755..7774c05a 100644 +--- a/sos/component.py ++++ b/sos/component.py +@@ -246,13 +246,13 @@ class SoSComponent(): + auto_archive = self.policy.get_preferred_archive() + self.archive = auto_archive(archive_name, self.tmpdir, + self.policy, self.opts.threads, +- enc_opts, self.opts.sysroot, ++ enc_opts, self.sysroot, + self.manifest) + + else: + self.archive = TarFileArchive(archive_name, self.tmpdir, + self.policy, self.opts.threads, +- enc_opts, self.opts.sysroot, ++ enc_opts, self.sysroot, + self.manifest) + + self.archive.set_debug(True if self.opts.debug else False) +-- +2.26.2 + diff --git a/SOURCES/sos-bz1895316-collector--cluster-type.patch b/SOURCES/sos-bz1895316-collector--cluster-type.patch new file mode 100644 index 0000000..03d8646 --- /dev/null +++ b/SOURCES/sos-bz1895316-collector--cluster-type.patch @@ -0,0 +1,32 @@ +From 1c6efee74557f433dfc5b67fb8ab76b0d9e6f988 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Tue, 8 Dec 2020 20:02:37 +0100 +Subject: [PATCH] [collector] allow overriding plain --cluster-type + +In few user scenarios, it is useful to force sos collect to override +cluster type, but let it generate list of nodes by itself. For that, +it is sufficient to set the self.cluster_type accordingly. + +Resolves: #2331 + +Signed-off-by: Pavel Moravec +Signed-off-by: Jake Hunsaker +--- + sos/collector/__init__.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sos/collector/__init__.py b/sos/collector/__init__.py +index 1abb08ae..bd84acaf 100644 +--- a/sos/collector/__init__.py ++++ b/sos/collector/__init__.py +@@ -764,6 +764,7 @@ class SoSCollector(SoSComponent): + self.cluster = self.clusters['jbon'] + else: + self.cluster = self.clusters[self.opts.cluster_type] ++ self.cluster_type = self.opts.cluster_type + self.cluster.master = self.master + + else: +-- +2.26.2 + diff --git a/SOURCES/sos-bz1904045-preset-ignores-verbosity.patch b/SOURCES/sos-bz1904045-preset-ignores-verbosity.patch new file mode 100644 index 0000000..608403d --- /dev/null +++ b/SOURCES/sos-bz1904045-preset-ignores-verbosity.patch @@ -0,0 +1,53 @@ +From 169898b47b26734a8cdcb748157f7314f7f8821b Mon Sep 17 00:00:00 2001 +From: Erik Bernoth +Date: Tue, 10 Nov 2020 18:32:40 +0100 +Subject: [PATCH] [component] Add log verbosity from presets + +Closes: #2289 + +The main problem this tries to solve was that preset verbosity was +ignored in logging. + +With a simple test this could be reproduced: +sudo sh -c "source /path/to/repo/sosreport/venv/bin/activate; \ + cd /tmp/foo; sos report --preset sostestpreset; cd -" + +The bug is that without a change of code there are no messages from the +plugin `host` (no lines of output start wiht "[plugin:host]"). + +The problem is that the logging is set in the inherited __init__() method +from Component, but the presets are only handled afterwards in the +Report's __init__(). + +Since it is good to have logging configured from the beginning, the +only option is to reconfigure it after the preset config is known. + +The simplest method is to reinitialize the logging, although maybe not +the most efficient. + +Signed-off-by: Erik Bernoth +Signed-off-by: Jake Hunsaker +--- + sos/report/__init__.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/sos/report/__init__.py b/sos/report/__init__.py +index 2e97010b..c6b0c21c 100644 +--- a/sos/report/__init__.py ++++ b/sos/report/__init__.py +@@ -153,6 +153,12 @@ class SoSReport(SoSComponent): + self.opts.merge(self.preset.opts) + # re-apply any cmdline overrides to the preset + self.opts = self.apply_options_from_cmdline(self.opts) ++ if hasattr(self.preset.opts, 'verbosity') and \ ++ self.preset.opts.verbosity > 0: ++ print('\nWARNING: It is not recommended to set verbosity via the ' ++ 'preset as it might have\nunforseen consequences for your ' ++ 'report logs.\n') ++ self._setup_logging() + + self._set_directories() + +-- +2.26.2 + diff --git a/SOURCES/sos-bz1905657-empty-file-stops-zero-sizelimit.patch b/SOURCES/sos-bz1905657-empty-file-stops-zero-sizelimit.patch new file mode 100644 index 0000000..13c05ed --- /dev/null +++ b/SOURCES/sos-bz1905657-empty-file-stops-zero-sizelimit.patch @@ -0,0 +1,56 @@ +From c2ddb50fbbb045daffa6fe5cf489fe47aeef4590 Mon Sep 17 00:00:00 2001 +From: Jake Hunsaker +Date: Wed, 9 Dec 2020 10:21:32 -0500 +Subject: [PATCH] [options] Fix --log-size=0 being ignored and unreported + otherwise + +The `--log-size` option was being silently ignored, due to a too-loose +conditional in `Component.apply_options_from_cmdline()` which was +inadvertently filtering out the option when a user set it to 0. Note +that this did not affect `sos.conf` settings for this same value. + +Similarly, reporting the effective options after preset and cmdline +merging was skipping log-size when it was set to 0, since we normally +want to filter out null-value options (which imply they were not +invoked). Adding an explicit check for `log-size` here is the easiest +route forward to allow the reporting we expect. + +Closes: #2334 +Resolves: #2335 + +Signed-off-by: Jake Hunsaker +--- + sos/component.py | 2 +- + sos/options.py | 3 +++ + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/sos/component.py b/sos/component.py +index 00f27f5e..69d3b755 100644 +--- a/sos/component.py ++++ b/sos/component.py +@@ -192,7 +192,7 @@ class SoSComponent(): + for opt, val in codict.items(): + if opt not in cmdopts.arg_defaults.keys(): + continue +- if val and val != opts.arg_defaults[opt]: ++ if val is not None and val != opts.arg_defaults[opt]: + setattr(opts, opt, val) + + return opts +diff --git a/sos/options.py b/sos/options.py +index ba3db130..b82a7d36 100644 +--- a/sos/options.py ++++ b/sos/options.py +@@ -282,6 +282,9 @@ class SoSOptions(): + """ + if name in ("add_preset", "del_preset", "desc", "note"): + return False ++ # Exception list for options that still need to be reported when 0 ++ if name in ['log_size', 'plugin_timeout'] and value == 0: ++ return True + return has_value(name, value) + + def argify(name, value): +-- +2.26.2 + diff --git a/SOURCES/sos-bz1906598-collect-broken-symlinks.patch b/SOURCES/sos-bz1906598-collect-broken-symlinks.patch new file mode 100644 index 0000000..2b324b7 --- /dev/null +++ b/SOURCES/sos-bz1906598-collect-broken-symlinks.patch @@ -0,0 +1,56 @@ +From 15e54577289a29e72c636f8987859e91c3a55a7c Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Thu, 10 Dec 2020 20:23:03 +0100 +Subject: [PATCH] [report] collect broken symlinks + +Information about broken symlink destination is useful information +that sos report should collect. Currently it stops doing so as +stat-ing the symlink to determine filesize fails. + +Closes: #2333 +Resolves: #2338 + +Signed-off-by: Pavel Moravec +Signed-off-by: Jake Hunsaker +--- + sos/report/plugins/__init__.py | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py +index 510e116e..1527caea 100644 +--- a/sos/report/plugins/__init__.py ++++ b/sos/report/plugins/__init__.py +@@ -1449,11 +1449,16 @@ class Plugin(object): + continue + + try: +- filestat = os.stat(_file) ++ file_size = os.stat(_file)[stat.ST_SIZE] + except OSError: +- self._log_info("failed to stat '%s'" % _file) +- continue +- current_size += filestat[stat.ST_SIZE] ++ # if _file is a broken symlink, we should collect it, ++ # otherwise skip it ++ if os.path.islink(_file): ++ file_size = 0 ++ else: ++ self._log_info("failed to stat '%s', skipping" % _file) ++ continue ++ current_size += file_size + + if sizelimit and current_size > sizelimit: + limit_reached = True +@@ -1467,8 +1472,7 @@ class Plugin(object): + strfile = ( + file_name.replace(os.path.sep, ".") + ".tailed" + ) +- add_size = (sizelimit + filestat[stat.ST_SIZE] +- - current_size) ++ add_size = sizelimit + file_size - current_size + self.add_string_as_file(tail(_file, add_size), strfile) + rel_path = os.path.relpath('/', os.path.dirname(_file)) + link_path = os.path.join(rel_path, 'sos_strings', +-- +2.26.2 + diff --git a/SPECS/sos.spec b/SPECS/sos.spec index 6fad6b4..d0b505f 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.0 -Release: 2%{?dist} +Release: 4%{?dist} Group: Applications/System Source0: https://github.com/sosreport/sos/archive/%{version}/sos-%{version}.tar.gz Source1: sos-audit-%{auditversion}.tgz @@ -13,14 +13,13 @@ License: GPLv2+ BuildArch: noarch Url: http://github.com/sosreport/sos BuildRequires: python3-devel -BuildRequires: python3-six BuildRequires: gettext Requires: libxml2-python3 Requires: bzip2 Requires: xz -Requires: python3-six Conflicts: vdsm < 4.40 Obsoletes: sos-collector +Recommends: python3-pexpect Patch1: sos-bz1827801-streamlined-sanitize_item.patch Patch2: sos-bz1874295-osp-ironic-inspector-configs.patch Patch3: sos-bz1880372-power-logs.patch @@ -30,6 +29,11 @@ Patch6: sos-bz1886782-exclude-panfs.patch Patch7: sos-bz1887390-kdump-logfiles.patch Patch8: sos-bz1888012-stratis-new-feature-output.patch Patch9: sos-bz1891562-tmp-dir-relative-path.patch +Patch10: sos-bz1848095-collect-rhev-pki.patch +Patch11: sos-bz1895316-collector--cluster-type.patch +Patch12: sos-bz1904045-preset-ignores-verbosity.patch +Patch13: sos-bz1905657-empty-file-stops-zero-sizelimit.patch +Patch14: sos-bz1906598-collect-broken-symlinks.patch %description Sos is a set of tools that gathers information about system @@ -49,6 +53,11 @@ support technicians and developers. %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 %build %py3_build @@ -56,7 +65,7 @@ support technicians and developers. %install %py3_install '--install-scripts=%{_sbindir}' -install -Dm644 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}.conf +install -Dm644 %{name}.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf %find_lang %{name} || echo 0 @@ -79,7 +88,7 @@ cd .. %{_mandir}/man5/sos.conf.5.gz %doc AUTHORS README.md %license LICENSE -%config(noreplace) %{_sysconfdir}/sos.conf +%config(noreplace) %{_sysconfdir}/sos/sos.conf %package audit Summary: Audit use of some commands for support purposes @@ -108,6 +117,22 @@ of the system. Currently storage and filesystem commands are audited. %ghost /etc/audit/rules.d/40-sos-storage.rules %changelog +* Mon Jan 04 2021 Pavel Moravec = 4.0-4 +- [component] Use sysroot from Policy when opts doesn't specify it + Resolves: bz1881118 + +* Mon Dec 14 2020 Pavel Moravec = 4.0-3 +- [ovirt] collect /etc/pki/ovirt-engine/.truststore + Resolves: bz1848095 +- [collector] allow overriding plain --cluster-type + Resolves: bz1895316 +- [component] Add log verbosity from presets + Resolves: bz1904045 +- [options] Fix --log-size=0 being ignored and unreported + Resolves: bz1905657 +- [report] collect broken symlinks + Resolves: bz1906598 + * Thu Oct 29 2020 Pavel Moravec = 4.0-2 - [cleaner] more streamlined sanitize_item method Resolves: bz1827801