diff --git a/SOURCES/sos-3.8-centos-branding.patch b/SOURCES/sos-3.8-centos-branding.patch deleted file mode 100644 index bf690d0..0000000 --- a/SOURCES/sos-3.8-centos-branding.patch +++ /dev/null @@ -1,96 +0,0 @@ -diff -uNrp sos-3.8.orig/sos/policies/redhat.py sos-3.8/sos/policies/redhat.py ---- sos-3.8.orig/sos/policies/redhat.py 2019-08-27 08:17:45.000000000 +0000 -+++ sos-3.8/sos/policies/redhat.py 2020-04-02 10:59:05.707237510 +0000 -@@ -23,9 +23,9 @@ OS_RELEASE = "/etc/os-release" - - - class RedHatPolicy(LinuxPolicy): -- distro = "Red Hat" -- vendor = "Red Hat" -- vendor_url = "http://www.redhat.com/" -+ distro = "CentOS" -+ vendor = "CentOS" -+ vendor_url = "http://www,centos.org/" - _redhat_release = '/etc/redhat-release' - _tmp_dir = "/var/tmp" - _rpmq_cmd = 'rpm -qa --queryformat "%{NAME}|%{VERSION}|%{RELEASE}\\n"' -@@ -77,9 +77,9 @@ class RedHatPolicy(LinuxPolicy): - - @classmethod - def check(cls): -- """This method checks to see if we are running on Red Hat. It must be -+ """This method checks to see if we are running on CentOS. It must be - overriden by concrete subclasses to return True when running on a -- Fedora, RHEL or other Red Hat distribution or False otherwise.""" -+ Fedora, RHEL or CentOS distribution or False otherwise.""" - return False - - def check_usrmove(self, pkgs): -@@ -180,22 +180,22 @@ _cb_plugs = ['abrt', 'block', 'boot', 'd - 'hardware', 'host', 'kernel', 'logs', 'lvm2', 'memory', 'rpm', - 'process', 'systemd', 'yum', 'xfs'] - --RHEL_RELEASE_STR = "Red Hat Enterprise Linux" -+RHEL_RELEASE_STR = "CentOS Linux" - - RHV = "rhv" --RHV_DESC = "Red Hat Virtualization" -+RHV_DESC = "Virtualization" - - RHEL = "rhel" - RHEL_DESC = RHEL_RELEASE_STR - - RHOSP = "rhosp" --RHOSP_DESC = "Red Hat OpenStack Platform" -+RHOSP_DESC = "OpenStack" - - RHOCP = "ocp" --RHOCP_DESC = "OpenShift Container Platform by Red Hat" -+RHOCP_DESC = "RDO" - - RH_SATELLITE = "satellite" --RH_SATELLITE_DESC = "Red Hat Satellite" -+RH_SATELLITE_DESC = "Satellite" - SAT_OPTS = SoSOptions(verify=True, plugopts=['apache.log=on']) - - CB = "cantboot" -@@ -235,9 +235,9 @@ No changes will be made to system config - - - class RHELPolicy(RedHatPolicy): -- distro = RHEL_RELEASE_STR -- vendor = "Red Hat" -- vendor_url = "https://access.redhat.com/support/" -+ distro = "CentOS Linux" -+ vendor = "CentOS" -+ vendor_url = "https://wiki.centos.org/" - msg = _("""\ - This command will collect diagnostic and configuration \ - information from this %(distro)s system and installed \ -@@ -256,7 +256,7 @@ support representative. - def check(cls): - """Test to see if the running host is a RHEL installation. - -- Checks for the presence of the "Red Hat Enterprise Linux" -+ Checks for the presence of the "CentOS Linux" - release string at the beginning of the NAME field in the - `/etc/os-release` file and returns ``True`` if it is - found, and ``False`` otherwise. -@@ -313,7 +313,7 @@ class CentOsPolicy(RHELPolicy): - - ATOMIC = "atomic" - ATOMIC_RELEASE_STR = "Atomic" --ATOMIC_DESC = "Red Hat Enterprise Linux Atomic Host" -+ATOMIC_DESC = "CentOS Linux Atomic Host" - - atomic_presets = { - ATOMIC: PresetDefaults(name=ATOMIC, desc=ATOMIC_DESC, note=NOTE_TIME, -@@ -322,7 +322,7 @@ atomic_presets = { - - - class RedHatAtomicPolicy(RHELPolicy): -- distro = "Red Hat Atomic Host" -+ distro = "CentOS Atomic Host" - msg = _("""\ - This command will collect diagnostic and configuration \ - information from this %(distro)s system. diff --git a/SOURCES/sos-bz1683904-option_to_limit_namespaces.patch b/SOURCES/sos-bz1683904-option_to_limit_namespaces.patch new file mode 100644 index 0000000..3b2fc30 --- /dev/null +++ b/SOURCES/sos-bz1683904-option_to_limit_namespaces.patch @@ -0,0 +1,176 @@ +From c20bd8d489c45401db55cf89bf7d4d0f7623a4fe Mon Sep 17 00:00:00 2001 +From: Jan Jansky +Date: Thu, 6 Feb 2020 08:56:11 +0100 +Subject: [PATCH] [networking] options to limit namespaces + +* Added posibility to define namespaces with +parameter namespaces = "". Posible regexp +like "eth* ens4". +* Added inspect_namespaces which defines how +many namespaces should be inspected, by +default unlimited +* Added ethtool_namespaces variable which +is by default true and if set to false it +will not execute ethtool commands for +namespaces +* Changed options for OpenStack environment +where ethtool_namespaces=False and +inspect_namespaces = 200 + +Closes: #1916 + +Signed-off-by: Jan Jansky +Signed-off-by: Pavel Moravec +--- +--- a/sos/plugins/networking.py ++++ b/sos/plugins/networking.py +@@ -9,7 +9,7 @@ + from sos.plugins import (Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin, + SoSPredicate) + from os import listdir +-import re ++from re import match + + + class Networking(Plugin): +@@ -18,10 +18,17 @@ + plugin_name = "networking" + profiles = ('network', 'hardware', 'system') + trace_host = "www.example.com" +- option_list = [( ++ option_list = [ + ("traceroute", "collect a traceroute to %s" % trace_host, "slow", +- False) +- )] ++ False), ++ ("namespace_pattern", "Specific namespaces pattern to be " + ++ "collected, namespaces pattern should be separated by whitespace " + ++ "as for example \"eth* ens2\"", "fast", ""), ++ ("namespaces", "Number of namespaces to collect, 0 for unlimited. " + ++ "Incompatible with the namespace_pattern plugin option", "slow", 0), ++ ("ethtool_namespaces", "Define if ethtool commands should be " + ++ "collected for namespaces", "slow", True) ++ ] + + # switch to enable netstat "wide" (non-truncated) output mode + ns_wide = "-W" +@@ -209,8 +216,41 @@ + # per-namespace. + ip_netns_file = self.get_cmd_output_now("ip netns") + cmd_prefix = "ip netns exec " ++ # Regex initialization outside of for loop + if ip_netns_file: +- for namespace in self.get_ip_netns(ip_netns_file): ++ if self.get_option("namespace_pattern"): ++ pattern = '(?:%s$)' % '$|'.join( ++ self.get_option("namespace_pattern").split() ++ ).replace('*', '.*') ++ out_ns = [] ++ with open(ip_netns_file, 'r') as file: ++ ip_netns = file.read() ++ for line in ip_netns.splitlines(): ++ # If there's no namespaces, no need to continue ++ if line.startswith("Object \"netns\" is unknown") \ ++ or line.isspace() \ ++ or line[:1].isspace(): ++ continue ++ ++ # if namespace_pattern defined, append only namespaces ++ # matching with pattern ++ if self.get_option("namespace_pattern"): ++ if bool(match(pattern, line)): ++ out_ns.append(line.partition(' ')[0]) ++ ++ # if namespaces is defined and namespace_pattern is not defined ++ # remove from out_ns namespaces with higher index than defined ++ elif self.get_option("namespaces") != 0: ++ out_ns.append(line.partition(' ')[0]) ++ if len(out_ns) == self.get_option("namespaces"): ++ self._log_warn("Limiting namespace iteration " + ++ "to first %s namespaces found" ++ % self.get_option("namespaces")) ++ break ++ else: ++ out_ns.append(line.partition(' ')[0]) ++ ++ for namespace in out_ns: + ns_cmd_prefix = cmd_prefix + namespace + " " + self.add_cmd_output([ + ns_cmd_prefix + "ip address show", +@@ -227,24 +267,27 @@ + # check for it + self.add_cmd_output(ss_cmd, pred=ss_pred) + +- # Devices that exist in a namespace use less ethtool +- # parameters. Run this per namespace. +- for namespace in self.get_ip_netns(ip_netns_file): +- ns_cmd_prefix = cmd_prefix + namespace + " " +- netns_netdev_list = self.call_ext_prog(ns_cmd_prefix + ++ # Collect ethtool commands only when ethtool_namespaces ++ # is set to true. ++ if self.get_option("ethtool_namespaces"): ++ # Devices that exist in a namespace use less ethtool ++ # parameters. Run this per namespace. ++ for namespace in out_ns: ++ ns_cmd_prefix = cmd_prefix + namespace + " " ++ netns_netdev_list = self.call_ext_prog(ns_cmd_prefix + + "ls -1 /sys/class/net/") +- for eth in netns_netdev_list['output'].splitlines(): +- # skip 'bonding_masters' file created when loading the +- # bonding module but the file does not correspond to +- # a device +- if eth == "bonding_masters": +- continue +- self.add_cmd_output([ +- ns_cmd_prefix + "ethtool " + eth, +- ns_cmd_prefix + "ethtool -i " + eth, +- ns_cmd_prefix + "ethtool -k " + eth, +- ns_cmd_prefix + "ethtool -S " + eth +- ]) ++ for eth in netns_netdev_list['output'].splitlines(): ++ # skip 'bonding_masters' file created when loading the ++ # bonding module but the file does not correspond to ++ # a device ++ if eth == "bonding_masters": ++ continue ++ self.add_cmd_output([ ++ ns_cmd_prefix + "ethtool " + eth, ++ ns_cmd_prefix + "ethtool -i " + eth, ++ ns_cmd_prefix + "ethtool -k " + eth, ++ ns_cmd_prefix + "ethtool -S " + eth ++ ]) + + return + +--- a/sos/policies/redhat.py ++++ b/sos/policies/redhat.py +@@ -174,8 +174,6 @@ + _opts_verify = SoSOptions(verify=True) + _opts_all_logs = SoSOptions(all_logs=True) + _opts_all_logs_verify = SoSOptions(all_logs=True, verify=True) +-_opts_all_logs_no_lsof = SoSOptions(all_logs=True, +- plugopts=['process.lsof=off']) + _cb_plugs = ['abrt', 'block', 'boot', 'dnf', 'dracut', 'filesys', 'grub2', + 'hardware', 'host', 'kernel', 'logs', 'lvm2', 'memory', 'rpm', + 'process', 'systemd', 'yum', 'xfs'] +@@ -190,6 +188,10 @@ + + RHOSP = "rhosp" + RHOSP_DESC = "Red Hat OpenStack Platform" ++RHOSP_OPTS = SoSOptions(plugopts=[ ++ 'process.lsof=off', ++ 'networking.ethtool_namespaces=False', ++ 'networking.namespaces=200']) + + RHOCP = "ocp" + RHOCP_DESC = "OpenShift Container Platform by Red Hat" +@@ -211,8 +213,7 @@ + RHV: PresetDefaults(name=RHV, desc=RHV_DESC, note=NOTE_TIME, + opts=_opts_verify), + RHEL: PresetDefaults(name=RHEL, desc=RHEL_DESC), +- RHOSP: PresetDefaults(name=RHOSP, desc=RHOSP_DESC, note=NOTE_SIZE, +- opts=_opts_all_logs_no_lsof), ++ RHOSP: PresetDefaults(name=RHOSP, desc=RHOSP_DESC, opts=RHOSP_OPTS), + RHOCP: PresetDefaults(name=RHOCP, desc=RHOCP_DESC, note=NOTE_SIZE_TIME, + opts=_opts_all_logs_verify), + RH_SATELLITE: PresetDefaults(name=RH_SATELLITE, desc=RH_SATELLITE_DESC, diff --git a/SPECS/sos.spec b/SPECS/sos.spec index 5016024..20cce2b 100644 --- a/SPECS/sos.spec +++ b/SPECS/sos.spec @@ -2,7 +2,7 @@ Summary: A set of tools to gather troubleshooting information from a system Name: sos Version: 3.8 -Release: 6%{?dist} +Release: 8%{?dist} Group: Applications/System Source0: https://github.com/sosreport/sos/archive/%{version}.tar.gz License: GPLv2+ @@ -18,6 +18,7 @@ Requires: xz Requires: python2-futures Obsoletes: sos-plugins-openstack Conflicts: vdsm <= 4.30.17 +Obsoletes: leapp-repository-sos-plugin Patch0: skip-generating-doc.patch Patch1: sos-bz1744555-ovn-plugins-containerized.patch Patch2: sos-bz1757662-kernel-trace-disabled.patch @@ -25,7 +26,7 @@ Patch3: sos-bz1699381-gluster-skip-statedump-dirs.patch Patch4: sos-bz1767445-interim-sysroot-forbidden-paths.patch Patch5: sos-bz1630028-manpages-allow-system-changes.patch Patch6: sos-bz1781148-foreman-psql-dynflow-explicit-cast.patch -Patch7: sos-3.8-centos-branding.patch +Patch7: sos-bz1683904-option_to_limit_namespaces.patch %description Sos is a set of tools that gathers information about system @@ -66,8 +67,13 @@ rm -rf ${RPM_BUILD_ROOT} %config(noreplace) %{_sysconfdir}/sos.conf %changelog -* Tue Mar 31 2020 CentOS Sources - 3.8-6.el7.centos -- Roll in CentOS Branding +* Mon Feb 24 2020 Jan Jansky = 3.8-8 +- Added Obsolete for leapp-repository-sos-plugin to solve + conflicts during install/upgrade/downgrade of RPM. + +* Wed Feb 19 2020 Jan Jansky = 3.8-7 +- [networking] options to limit namespaces + Resolves: bz1683904 * Wed Dec 11 2019 Pavel Moravec = 3.8-6 - [foreman] cast dynflow_execution_plans.uuid as varchar