diff --git a/.gitignore b/.gitignore index e94eaf0..44b2ba9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/3.8.tar.gz +SOURCES/3.9.tar.gz diff --git a/.sos.metadata b/.sos.metadata index 8c18b5f..555ab8a 100644 --- a/.sos.metadata +++ b/.sos.metadata @@ -1 +1 @@ -99c94319c6208edef8d852b9e84cbb045c01df5f SOURCES/3.8.tar.gz +c89fcb9417d884e7d176d4110323e9442b928378 SOURCES/3.9.tar.gz diff --git a/SOURCES/sos-3.8-centos-branding.patch b/SOURCES/sos-3.8-centos-branding.patch deleted file mode 100644 index 290268f..0000000 --- a/SOURCES/sos-3.8-centos-branding.patch +++ /dev/null @@ -1,100 +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 2020-05-12 15:45:00.128929276 +0000 -+++ sos-3.8/sos/policies/redhat.py 2020-05-12 15:59:16.328778927 +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): -@@ -178,26 +178,26 @@ _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" - RHOSP_OPTS = SoSOptions(plugopts=[ - 'process.lsof=off', - 'networking.ethtool_namespaces=False', - 'networking.namespaces=200']) - - 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" -@@ -236,9 +236,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 \ -@@ -257,7 +257,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. -@@ -314,7 +314,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, -@@ -323,7 +323,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-bz1538226-insights_collect_insights_archive_if_available.patch b/SOURCES/sos-bz1538226-insights_collect_insights_archive_if_available.patch new file mode 100644 index 0000000..ebaba09 --- /dev/null +++ b/SOURCES/sos-bz1538226-insights_collect_insights_archive_if_available.patch @@ -0,0 +1,35 @@ +From a2f8d3bea955568f97367f75720728619b12276a Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Fri, 24 Apr 2020 11:41:54 +0200 +Subject: [PATCH] [insights] collect insights-client dump + +Collect data of "insights-client --offline" into +sos_commands/insights/insights-client-dump directory. + +Related: #2030 +Resolves: #2032 + +Signed-off-by: Pavel Moravec +Signed-off-by: Jake Hunsaker +--- + sos/plugins/insights.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/sos/plugins/insights.py b/sos/plugins/insights.py +index a944e49..62ece8b 100644 +--- a/sos/plugins/insights.py ++++ b/sos/plugins/insights.py +@@ -31,6 +31,10 @@ class RedHatInsights(Plugin, RedHatPlugin): + else: + self.add_copy_spec("/var/log/insights-client/insights-client.log") + ++ # Collect insights-client report data into given dump dir ++ path = self.get_cmd_output_path(name="insights-client-dump") ++ self.add_cmd_output("insights-client --offline --output-dir %s" % path) ++ + def postproc(self): + for conf in self.config: + self.do_file_sub( +-- +1.8.3.1 + diff --git a/SOURCES/sos-bz1630028-manpages-allow-system-changes.patch b/SOURCES/sos-bz1630028-manpages-allow-system-changes.patch deleted file mode 100644 index fc1a27e..0000000 --- a/SOURCES/sos-bz1630028-manpages-allow-system-changes.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b103c4a9e0c93f18576205eee7b8e0989aaf559d Mon Sep 17 00:00:00 2001 -From: Pavel Moravec -Date: Tue, 12 Nov 2019 19:12:45 +0100 -Subject: [PATCH] [man] describe --allow-system-changes (#1850) - -In #1435, --allow-system-changes option was added that is documented -in sosreport --help but not in manpages. - -Resolves: #1850 - -Signed-off-by: Pavel Moravec -Signed-off-by: Bryan Quigley ---- - man/en/sosreport.1 | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/man/en/sosreport.1 b/man/en/sosreport.1 -index 649cba0..a885d56 100644 ---- a/man/en/sosreport.1 -+++ b/man/en/sosreport.1 -@@ -25,6 +25,7 @@ sosreport \- Collect and package diagnostic and support data - [--log-size]\fR - [--all-logs]\fR - [--since YYYYMMDD[HHMMSS]]\fR -+ [--allow-system-changes]\fR - [-z|--compression-type method]\fR - [--encrypt-key KEY]\fR - [--encrypt-pass PASS]\fR -@@ -160,6 +161,9 @@ increase the size of reports. - Limits the collection to logs newer than this date. - This also affects \--all-logs. Will pad with 0s if HHMMSS isn't specified. - .TP -+.B \--allow-system-changes -+Run commands even if they can change the system (e.g. load kernel modules). -+.TP - .B \-z, \--compression-type METHOD - Override the default compression type specified by the active policy. - .TP --- -1.8.3.1 - diff --git a/SOURCES/sos-bz1683904-option_to_limit_namespaces.patch b/SOURCES/sos-bz1683904-option_to_limit_namespaces.patch deleted file mode 100644 index 3b2fc30..0000000 --- a/SOURCES/sos-bz1683904-option_to_limit_namespaces.patch +++ /dev/null @@ -1,176 +0,0 @@ -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/SOURCES/sos-bz1699381-gluster-skip-statedump-dirs.patch b/SOURCES/sos-bz1699381-gluster-skip-statedump-dirs.patch deleted file mode 100644 index 5f48848..0000000 --- a/SOURCES/sos-bz1699381-gluster-skip-statedump-dirs.patch +++ /dev/null @@ -1,33 +0,0 @@ -From a36c892e7a60ef5bba03e07c12ef1939fd2f0a45 Mon Sep 17 00:00:00 2001 -From: Pavel Moravec -Date: Wed, 2 Oct 2019 16:55:05 +0200 -Subject: [PATCH] [gluster] process files only from a statedump dir - -Traversing statedump dir for statedump files must skip -subdirectories (where the dump files won't appear). - -Resolves: #1812 - -Signed-off-by: Pavel Moravec ---- - sos/plugins/gluster.py | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/sos/plugins/gluster.py b/sos/plugins/gluster.py -index 101b0da2..ae770f07 100644 ---- a/sos/plugins/gluster.py -+++ b/sos/plugins/gluster.py -@@ -42,7 +42,9 @@ class Gluster(Plugin, RedHatPlugin): - - def wait_for_statedump(self, name_dir): - statedumps_present = 0 -- statedump_entries = os.listdir(name_dir) -+ statedump_entries = [ -+ f for f in os.listdir(name_dir) if os.path.isfile(f) -+ ] - for statedump_file in statedump_entries: - statedumps_present = statedumps_present+1 - ret = -1 --- -2.21.0 - diff --git a/SOURCES/sos-bz1744555-ovn-plugins-containerized.patch b/SOURCES/sos-bz1744555-ovn-plugins-containerized.patch deleted file mode 100644 index 7b3dbfe..0000000 --- a/SOURCES/sos-bz1744555-ovn-plugins-containerized.patch +++ /dev/null @@ -1,264 +0,0 @@ -From cc6374914a47eb3777c5b8306506df43522a31e0 Mon Sep 17 00:00:00 2001 -From: Daniel Alvarez -Date: Thu, 18 Jul 2019 14:08:27 +0200 -Subject: [PATCH 1/4] [ovn_central] add additional show commands - -This patch is adding 'show' commands for both OVN -NorthBound and SouthBound databases. - -Signed-off-by: Daniel Alvarez -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/ovn_central.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/sos/plugins/ovn_central.py b/sos/plugins/ovn_central.py -index e0585687..2d252625 100644 ---- a/sos/plugins/ovn_central.py -+++ b/sos/plugins/ovn_central.py -@@ -57,6 +57,8 @@ class OVNCentral(Plugin): - - # Some user-friendly versions of DB output - cmds = [ -+ 'ovn-nbctl show', -+ 'ovn-sbctl show', - 'ovn-sbctl lflow-list', - 'ovn-nbctl get-ssl', - 'ovn-nbctl get-connection', --- -2.21.0 - - -From 5fd4e850ad9a6636d0fb206954e8ab016584974d Mon Sep 17 00:00:00 2001 -From: Daniel Alvarez -Date: Wed, 11 Sep 2019 16:19:15 +0100 -Subject: [PATCH 2/4] [ovn_host] fix Open_vSwitch table name - -Signed-off-by: Daniel Alvarez -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/ovn_host.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sos/plugins/ovn_host.py b/sos/plugins/ovn_host.py -index 54251627..ba35d87e 100644 ---- a/sos/plugins/ovn_host.py -+++ b/sos/plugins/ovn_host.py -@@ -35,7 +35,7 @@ class OVNHost(Plugin): - self.add_cmd_output([ - 'ovs-ofctl -O OpenFlow13 dump-flows br-int', - 'ovs-vsctl list-br', -- 'ovs-vsctl list OpenVswitch', -+ 'ovs-vsctl list Open_vSwitch', - ]) - - self.add_journal(units="ovn-controller") --- -2.21.0 - - -From 3c842046e9c4c5b371566347f51e5e242daf4f8d Mon Sep 17 00:00:00 2001 -From: Daniel Alvarez -Date: Tue, 23 Jul 2019 12:44:07 +0200 -Subject: [PATCH 3/4] [ovn_central] Add support to containerized setups - -This patch is adding support in ovn_central plugin to containerized -setups. - -Now it's detecting if the OVN central services are running in -container and execute the relevant commands inside it. The support -covers both podman and docker runtimes. - -Signed-off-by: Daniel Alvarez ---- - sos/plugins/ovn_central.py | 94 ++++++++++++++++++++++++++++---------- - 1 file changed, 69 insertions(+), 25 deletions(-) - -diff --git a/sos/plugins/ovn_central.py b/sos/plugins/ovn_central.py -index 2d252625..a9fcdf33 100644 ---- a/sos/plugins/ovn_central.py -+++ b/sos/plugins/ovn_central.py -@@ -19,30 +19,64 @@ class OVNCentral(Plugin): - """ - plugin_name = "ovn_central" - profiles = ('network', 'virt') -- -- def add_database_output(self, filename, cmds, ovn_cmd, skip=[]): -+ _container_runtime = None -+ _container_name = None -+ -+ def get_tables_from_schema(self, filename, skip=[]): -+ if self._container_name: -+ cmd = "%s exec %s cat %s" % ( -+ self._container_runtime, self._container_name, filename) -+ res = self.get_command_output(cmd) -+ if res['status'] != 0: -+ self._log_error("Could not retrieve DB schema file from " -+ "container %s" % self._container_name) -+ return -+ try: -+ db = json.loads(res['output']) -+ except Exception: -+ self._log_error("Cannot parse JSON file %s" % filename) -+ return -+ else: -+ try: -+ with open(filename, 'r') as f: -+ try: -+ db = json.load(f) -+ except Exception: -+ self._log_error( -+ "Cannot parse JSON file %s" % filename) -+ return -+ except IOError as ex: -+ self._log_error( -+ "Could not open DB schema file %s: %s" % (filename, ex)) -+ return - try: -- with open(filename, 'r') as f: -- try: -- db = json.load(f) -- except Exception: -- # If json can't be parsed, then exit early -- self._log_error("Cannot parse JSON file %s" % filename) -- return -- try: -- for table in six.iterkeys(db['tables']): -- if table not in skip: -- cmds.append('%s list %s' % (ovn_cmd, table)) -- except AttributeError: -- self._log_error("DB schema %s has no 'tables' key" % -- filename) -- return -- except IOError as ex: -- self._log_error("Could not open DB schema file %s: %s" % (filename, -- ex)) -- return -+ return [table for table in six.iterkeys( -+ db['tables']) if table not in skip] -+ except AttributeError: -+ self._log_error("DB schema %s has no 'tables' key" % filename) -+ -+ def add_database_output(self, tables, cmds, ovn_cmd): -+ for table in tables: -+ cmds.append('%s list %s' % (ovn_cmd, table)) -+ -+ def running_in_container(self): -+ for runtime in ["podman", "docker"]: -+ container_status = self.get_command_output(runtime + " ps") -+ if container_status['status'] == 0: -+ for line in container_status['output'].splitlines(): -+ if "ovn-dbs-bundle" in line: -+ self._container_name = line.split()[-1] -+ self._container_runtime = runtime -+ return True -+ return False -+ -+ def check_enabled(self): -+ return (self.running_in_container() or -+ super(OVNCentral, self).check_enabled()) - - def setup(self): -+ containerized = self.running_in_container() -+ - ovs_rundir = os.environ.get('OVS_RUNDIR') - for pidfile in ['ovnnb_db.pid', 'ovnsb_db.pid', 'ovn-northd.pid']: - self.add_copy_spec([ -@@ -68,10 +102,20 @@ class OVNCentral(Plugin): - - schema_dir = '/usr/share/openvswitch' - -- self.add_database_output(os.path.join(schema_dir, 'ovn-nb.ovsschema'), -- cmds, 'ovn-nbctl') -- self.add_database_output(os.path.join(schema_dir, 'ovn-sb.ovsschema'), -- cmds, 'ovn-sbctl', ['Logical_Flow']) -+ nb_tables = self.get_tables_from_schema(os.path.join( -+ schema_dir, 'ovn-nb.ovsschema')) -+ sb_tables = self.get_tables_from_schema(os.path.join( -+ schema_dir, 'ovn-sb.ovsschema'), ['Logical_Flow']) -+ -+ self.add_database_output(nb_tables, cmds, 'ovn-nbctl') -+ self.add_database_output(sb_tables, cmds, 'ovn-sbctl') -+ -+ # If OVN is containerized, we need to run the above commands inside -+ # the container. -+ if containerized: -+ cmds = ['%s exec %s %s' % (self._container_runtime, -+ self._container_name, -+ cmd) for cmd in cmds] - - self.add_cmd_output(cmds) - --- -2.21.0 - - -From a895bf4096f1dbd71c9dbd4defb47783f4ef9840 Mon Sep 17 00:00:00 2001 -From: Daniel Alvarez -Date: Thu, 25 Jul 2019 11:42:16 +0200 -Subject: [PATCH 4/4] [ovn_host] Add support for containerized setups - -Prior to this patch, ovn_host was disabled on containerized -setups due to the fact that ovn-controller package is not -installed in the host. - -This patch fixes it by checking if the ovn-controller process -is running. - -Resolves: #1767 - -Signed-off-by: Daniel Alvarez -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/ovn_host.py | 21 ++++++++++++++------- - 1 file changed, 14 insertions(+), 7 deletions(-) - -diff --git a/sos/plugins/ovn_host.py b/sos/plugins/ovn_host.py -index ba35d87e..5225f010 100644 ---- a/sos/plugins/ovn_host.py -+++ b/sos/plugins/ovn_host.py -@@ -12,6 +12,15 @@ import os - from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin - - -+pidfile = 'ovn-controller.pid' -+pid_paths = [ -+ '/var/lib/openvswitch/ovn', -+ '/usr/local/var/run/openvswitch', -+ '/var/run/openvswitch', -+ '/run/openvswitch' -+] -+ -+ - class OVNHost(Plugin): - """ OVN Controller - """ -@@ -19,13 +28,6 @@ class OVNHost(Plugin): - profiles = ('network', 'virt') - - def setup(self): -- pidfile = 'ovn-controller.pid' -- pid_paths = [ -- '/var/lib/openvswitch/ovn', -- '/usr/local/var/run/openvswitch', -- '/var/run/openvswitch', -- '/run/openvswitch' -- ] - if os.environ.get('OVS_RUNDIR'): - pid_paths.append(os.environ.get('OVS_RUNDIR')) - self.add_copy_spec([os.path.join(pp, pidfile) for pp in pid_paths]) -@@ -40,6 +42,11 @@ class OVNHost(Plugin): - - self.add_journal(units="ovn-controller") - -+ def check_enabled(self): -+ return (any([os.path.isfile( -+ os.path.join(pp, pidfile)) for pp in pid_paths]) or -+ super(OVNHost, self).check_enabled()) -+ - - class RedHatOVNHost(OVNHost, RedHatPlugin): - --- -2.21.0 - diff --git a/SOURCES/sos-bz1757662-kernel-trace-disabled.patch b/SOURCES/sos-bz1757662-kernel-trace-disabled.patch deleted file mode 100644 index 6ff44d6..0000000 --- a/SOURCES/sos-bz1757662-kernel-trace-disabled.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 55949fb88c492eec542c69157a8763ddb3555345 Mon Sep 17 00:00:00 2001 -From: MIZUTA Takeshi -Date: Thu, 6 Jun 2019 18:42:40 +0900 -Subject: [PATCH] [plugins] Change forbidden_path from partial-match to - exact-match - -forbidden_path is evaluated on partial-match. -However, it will be correct to evaluate on exact-match. - -Closes: #1692 -Resolves: #1695 - -Signed-off-by: MIZUTA Takeshi -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/__init__.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py -index 56af847a..41f4f58c 100644 ---- a/sos/plugins/__init__.py -+++ b/sos/plugins/__init__.py -@@ -64,7 +64,7 @@ def _mangle_command(command, name_max): - - - def _path_in_path_list(path, path_list): -- return any(p in path for p in path_list) -+ return any(p == path for p in path_list) - - - def _node_type(st): --- -2.21.0 - -From d2d5b9da6d4af7ead8a47468db0bbfcc8fb2b5bf Mon Sep 17 00:00:00 2001 -From: Pavel Moravec -Date: Thu, 26 Sep 2019 10:50:18 +0200 -Subject: [PATCH] [kernel] Don't collect trace file by default - -Updates the plugin to don't collect trace file by default. Collecting -trace file may take a lot of time, so trace file is not collected -by default, and use the new plug-in option when collecting. - -Original author: MIZUTA Takeshi - -Closes: #1688 -Resolves: #1800 - -Signed-off-by: Pavel Moravec -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/kernel.py | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/sos/plugins/kernel.py b/sos/plugins/kernel.py -index bf3c3dea..b498f55e 100644 ---- a/sos/plugins/kernel.py -+++ b/sos/plugins/kernel.py -@@ -23,7 +23,8 @@ class Kernel(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): - sys_module = '/sys/module' - - option_list = [ -- ("with-timer", "gather /proc/timer* statistics", "slow", False) -+ ("with-timer", "gather /proc/timer* statistics", "slow", False), -+ ("trace", "gather /sys/kernel/debug/tracing/trace file", "slow", False) - ] - - def get_bpftool_prog_ids(self, prog_file): -@@ -139,6 +139,9 @@ class Kernel(Plugin, RedHatPlugin, Debia - # and may also cause softlockups - self.add_copy_spec("/proc/timer*") - -+ if not self.get_option("trace"): -+ self.add_forbidden_path("/sys/kernel/debug/tracing/trace") -+ - # collect list of eBPF programs and maps and their dumps - prog_file = self.get_cmd_output_now("bpftool -j prog list") - for prog_id in self.get_bpftool_prog_ids(prog_file): --- -2.21.0 - diff --git a/SOURCES/sos-bz1767445-interim-sysroot-forbidden-paths.patch b/SOURCES/sos-bz1767445-interim-sysroot-forbidden-paths.patch deleted file mode 100644 index e75653a..0000000 --- a/SOURCES/sos-bz1767445-interim-sysroot-forbidden-paths.patch +++ /dev/null @@ -1,447 +0,0 @@ -From 9a0ab16793a8388b2c3d3909fd3a087c5b6296d4 Mon Sep 17 00:00:00 2001 -From: Pavel Moravec -Date: Fri, 1 Nov 2019 12:13:23 -0400 -Subject: [PATCH 01/10] [Plugin] remove invalid {strip/join}_sysroot() - -Do not strip the sysroot path prefix when calling _do_copy_path() -for a symlink target and do not add the sysroot prefix when -testing for a forbidden path. - -Related: #1842 - -Signed-off-by: Pavel Moravec -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/__init__.py | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py -index e75ec82e..4f1b73ce 100644 ---- a/sos/plugins/__init__.py -+++ b/sos/plugins/__init__.py -@@ -731,7 +731,7 @@ class Plugin(object): - - # skip recursive copying of symlink pointing to itself. - if (absdest != srcpath): -- self._do_copy_path(self.strip_sysroot(absdest)) -+ self._do_copy_path(absdest) - else: - self._log_debug("link '%s' points to itself, skipping target..." - % linkdest) -@@ -758,8 +758,6 @@ class Plugin(object): - return None - - def _is_forbidden_path(self, path): -- if self.use_sysroot(): -- path = self.join_sysroot(path) - return _path_in_path_list(path, self.forbidden_paths) - - def _copy_node(self, path, st): --- -2.21.0 - - -From aeeebf126fc9fdb0fd8c3b01418bef742bce78c3 Mon Sep 17 00:00:00 2001 -From: "Bryn M. Reeves" -Date: Fri, 1 Nov 2019 12:22:51 -0400 -Subject: [PATCH 02/10] [Plugin] fix destination paths in _do_copy_path() - -The path used to copy special device nodes and directories in -_do_copy_path() should be the destination path in the archive -(without sysroot prefix), and not the source path in the host -file system that includes this prefix. - -Related: #1842 - -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/__init__.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py -index 4f1b73ce..60fbeaf7 100644 ---- a/sos/plugins/__init__.py -+++ b/sos/plugins/__init__.py -@@ -721,8 +721,12 @@ class Plugin(object): - return - else: - if stat.S_ISDIR(st.st_mode) and os.access(srcpath, os.R_OK): -- self._copy_dir(srcpath) -- return -+ # copy empty directory -+ if not os.listdir(srcpath): -+ self.archive.add_dir(dest) -+ return -+ self._copy_dir(dest) -+ return - - # handle special nodes (block, char, fifo, socket) - if not (stat.S_ISREG(st.st_mode) or stat.S_ISDIR(st.st_mode)): -@@ -808,7 +808,7 @@ class Plugin(object): - ntype = _node_type(st) - self._log_debug("creating %s node at archive:'%s'" - % (ntype, dest)) -- self._copy_node(srcpath, st) -+ self._copy_node(dest, st) - return - - # if we get here, it's definitely a regular file (not a symlink or dir) --- -2.21.0 - - -From 05f3d5bda8f548459fabcd38f2d087d6ecef98a2 Mon Sep 17 00:00:00 2001 -From: "Bryn M. Reeves" -Date: Fri, 1 Nov 2019 12:25:09 -0400 -Subject: [PATCH 03/10] [kernel] remove trailing directory globs in forbidden - paths - -Since the forbidden path test now uses an exact match the trailing -globs ("/some/directory/path/to/exclude/*") used to exclude trace -related directories from collection lead to a failure to properly -blacklist these files: - -The glob is expanded, for e.g.: - - "/sys/kernel/debug/tracing/per_cpu/*" - -Expands to unclude a 'cpuN' sub-directory for each CPU present on -the machine. These expanded paths are then added to the forbidden -paths list for the plugin: - - /sys/kernel/debug/tracing/per_cpu/cpu0 - /sys/kernel/debug/tracing/per_cpu/cpu1 - ... - -When an attempt is made to collect the entire "per_cpu" directory -a check is made for the full "/sys/kernel/debug/tracing/per_cpu" -path against each entry in the forbidden paths list. Since this is -a prefix of the actual paths stored no match is returned and the -collection is permitted. - -Remove the trailing globs from these directory paths and prevent -any collection of the directories they reference by the plugin. - -Related: #1842 - -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/kernel.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/sos/plugins/kernel.py b/sos/plugins/kernel.py -index 88b14689..5c852143 100644 ---- a/sos/plugins/kernel.py -+++ b/sos/plugins/kernel.py -@@ -89,9 +89,9 @@ class Kernel(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): - self.add_forbidden_path([ - '/sys/kernel/debug/tracing/trace_pipe', - '/sys/kernel/debug/tracing/README', -- '/sys/kernel/debug/tracing/trace_stat/*', -- '/sys/kernel/debug/tracing/per_cpu/*', -- '/sys/kernel/debug/tracing/events/*', -+ '/sys/kernel/debug/tracing/trace_stat', -+ '/sys/kernel/debug/tracing/per_cpu', -+ '/sys/kernel/debug/tracing/events', - '/sys/kernel/debug/tracing/free_buffer', - '/sys/kernel/debug/tracing/trace_marker', - '/sys/kernel/debug/tracing/trace_marker_raw', --- -2.21.0 - - -From 801c71b33dcfeaa980baa9f377b721bdd26aa5e8 Mon Sep 17 00:00:00 2001 -From: "Bryn M. Reeves" -Date: Fri, 1 Nov 2019 16:53:29 +0000 -Subject: [PATCH 04/10] [tests] fix test_copy_dir_forbidden_path - -Rather than call just Plugin.setup() and Plugin._do_copy_path(), -add an add_copy_spec() call to the mock plugin setup() method, -and invoke copying by calling the Plugin.collect() method. - -Related: #1845 - -Signed-off-by: Bryn M. Reeves ---- - tests/plugin_tests.py | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/tests/plugin_tests.py b/tests/plugin_tests.py -index b8760429..6522fe14 100644 ---- a/tests/plugin_tests.py -+++ b/tests/plugin_tests.py -@@ -81,6 +81,7 @@ class ForbiddenMockPlugin(Plugin): - plugin_name = "forbidden" - - def setup(self): -+ self.add_copy_spec("tests") - self.add_forbidden_path("tests") - - -@@ -235,7 +236,7 @@ class PluginTests(unittest.TestCase): - }) - p.archive = MockArchive() - p.setup() -- p._do_copy_path("tests") -+ p.collect() - self.assertEquals(p.archive.m, {}) - - --- -2.21.0 - - - -From 68f4d7cc7adde00171af842b5bc808f41d888a87 Mon Sep 17 00:00:00 2001 -From: "Bryn M. Reeves" -Date: Mon, 4 Nov 2019 10:48:01 +0000 -Subject: [PATCH 06/10] [Plugin] improve _copy_dir() variable naming - -Directory entries found in _copy_dir() may be either files or -sub-directories: reflect this in the names of local variables. - -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/__init__.py | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py -index 240fe9f1..1a1464c1 100644 ---- a/sos/plugins/__init__.py -+++ b/sos/plugins/__init__.py -@@ -738,10 +738,11 @@ class Plugin(object): - - def _copy_dir(self, srcpath): - try: -- for afile in os.listdir(srcpath): -+ for name in os.listdir(srcpath): - self._log_debug("recursively adding '%s' from '%s'" -- % (afile, srcpath)) -- self._do_copy_path(os.path.join(srcpath, afile), dest=None) -+ % (name, srcpath)) -+ path = os.path.join(srcpath, name) -+ self._do_copy_path(path) - except OSError as e: - if e.errno == errno.ELOOP: - msg = "Too many levels of symbolic links copying" --- -2.21.0 - - -From ad3adef07c32aee5bdd438706c6c1d4590ff8297 Mon Sep 17 00:00:00 2001 -From: "Bryn M. Reeves" -Date: Mon, 4 Nov 2019 14:13:00 +0000 -Subject: [PATCH 07/10] [ceph] fix directory blacklist style - -Plugins must use 'path/to/exclude' rather than 'path/to/exclude/*' -in order to omit a directory and all its content from the report. - -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/ceph.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/sos/plugins/ceph.py b/sos/plugins/ceph.py -index 6e340c69..43284bc8 100644 ---- a/sos/plugins/ceph.py -+++ b/sos/plugins/ceph.py -@@ -103,8 +103,8 @@ class Ceph(Plugin, RedHatPlugin, UbuntuPlugin): - "/var/lib/ceph/*keyring*", - "/var/lib/ceph/*/*keyring*", - "/var/lib/ceph/*/*/*keyring*", -- "/var/lib/ceph/osd/*", -- "/var/lib/ceph/mon/*", -+ "/var/lib/ceph/osd", -+ "/var/lib/ceph/mon", - # Excludes temporary ceph-osd mount location like - # /var/lib/ceph/tmp/mnt.XXXX from sos collection. - "/var/lib/ceph/tmp/*mnt*", --- -2.21.0 - - -From 4d1576b04d35902ce44d26d6a5b2219e6f9c175a Mon Sep 17 00:00:00 2001 -From: "Bryn M. Reeves" -Date: Mon, 4 Nov 2019 14:15:55 +0000 -Subject: [PATCH 09/10] [openstack_octavia] fix directory blacklist style - -Plugins must use 'path/to/exclude' rather than 'path/to/exclude/*' -in order to omit a directory and all its content from the report. - -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/openstack_octavia.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sos/plugins/openstack_octavia.py b/sos/plugins/openstack_octavia.py -index b97c83fa..ccdcd4c9 100644 ---- a/sos/plugins/openstack_octavia.py -+++ b/sos/plugins/openstack_octavia.py -@@ -30,7 +30,7 @@ class OpenStackOctavia(Plugin): - ]) - - # don't collect certificates -- self.add_forbidden_path("/etc/octavia/certs/") -+ self.add_forbidden_path("/etc/octavia/certs") - - # logs - if self.get_option("all_logs"): --- -2.21.0 - - -From 1fd194191a56c51052f0c24ddeb3bbf9088ae0ca Mon Sep 17 00:00:00 2001 -From: "Bryn M. Reeves" -Date: Mon, 4 Nov 2019 14:16:13 +0000 -Subject: [PATCH 10/10] [vdsm] fix directory blacklist style - -Plugins must use 'path/to/exclude' rather than 'path/to/exclude/*' -in order to omit a directory and all its content from the report. - -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/vdsm.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/sos/plugins/vdsm.py b/sos/plugins/vdsm.py -index b2a1ca58..69672643 100644 ---- a/sos/plugins/vdsm.py -+++ b/sos/plugins/vdsm.py -@@ -60,9 +60,9 @@ class Vdsm(Plugin, RedHatPlugin): - plugin_name = 'vdsm' - - def setup(self): -- self.add_forbidden_path('/etc/pki/vdsm/keys/*') -+ self.add_forbidden_path('/etc/pki/vdsm/keys') - self.add_forbidden_path('/etc/pki/vdsm/libvirt-spice/*-key.*') -- self.add_forbidden_path('/etc/pki/libvirt/private/*') -+ self.add_forbidden_path('/etc/pki/libvirt/private') - - self.add_cmd_output('service vdsmd status') - self.add_cmd_output('service supervdsmd status') --- -2.21.0 - -From 87dbc4d961d9e98f4e8b7b54010800ff3bdb5a73 Mon Sep 17 00:00:00 2001 -From: Jake Hunsaker -Date: Mon, 11 Nov 2019 12:43:01 -0500 -Subject: [PATCH] [Plugin|Policy] Only call lsmod once and standardize kmod - checks - -This commit makes two changes to how sos deals with kernel modules and -their state during a run of sosreport. - -First, no longer call `lsmod` for every individual plugin during its -enablement check. Instead, call `lsmod` only once during `Policy` -initialization, and cache the output for later checks. - -Second, have `Plugin.is_module_loaded()` check for kmod presence in the -saved policy class attr for kernel_mods, rather than checking through -`/proc/modules`. Have the plugin enablement checks now also use -`is_module_loaded()` to standardize with how `SoSPredicate`s are -checked. - -Note that this change results in a significant performance increase for -sos initialization times in a RHEL 7 container. - -Resolves: #1854 - -Signed-off-by: Jake Hunsaker ---- - sos/plugins/__init__.py | 13 +++---------- - sos/policies/__init__.py | 8 +++++--- - 2 files changed, 8 insertions(+), 13 deletions(-) - -diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py -index 1a1464c11..b7a47b6a4 100644 ---- a/sos/plugins/__init__.py -+++ b/sos/plugins/__init__.py -@@ -1170,11 +1170,8 @@ - sizelimit=sizelimit) - - def is_module_loaded(self, module_name): -- """Return whether specified moudle as module_name is loaded or not""" -- if len(grep("^" + module_name + " ", "/proc/modules")) == 0: -- return False -- else: -- return True -+ """Return whether specified module as module_name is loaded or not""" -+ return module_name in self.policy.kernel_mods - - # For adding output - def add_alert(self, alertstring): -@@ -1408,15 +1408,11 @@ - return True - - def _check_plugin_triggers(self, files, packages, commands, services): -- kernel_mods = self.policy.lsmod() -- -- def have_kmod(kmod): -- return kmod in kernel_mods - - return (any(os.path.exists(fname) for fname in files) or - any(self.is_installed(pkg) for pkg in packages) or - any(is_executable(cmd) for cmd in commands) or -- any(have_kmod(kmod) for kmod in self.kernel_mods) or -+ any(self.is_module_loaded(mod) for mod in self.kernel_mods) or - any(self.is_service(svc) for svc in services)) - - def default_enabled(self): - -diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py -index a19daf227..f4aa31801 100644 ---- a/sos/policies/__init__.py -+++ b/sos/policies/__init__.py -@@ -822,6 +822,7 @@ class LinuxPolicy(Policy): - - def __init__(self, sysroot=None): - super(LinuxPolicy, self).__init__(sysroot=sysroot) -+ self.init_kernel_modules() - if self.init == 'systemd': - self.init_system = SystemdInit() - else: -@@ -874,11 +875,12 @@ def get_local_name(self): - def sanitize_filename(self, name): - return re.sub(r"[^-a-z,A-Z.0-9]", "", name) - -- def lsmod(self): -- """Return a list of kernel module names as strings. -+ def init_kernel_modules(self): -+ """Obtain a list of loaded kernel modules to reference later for plugin -+ enablement and SoSPredicate checks - """ - lines = shell_out("lsmod", timeout=0).splitlines() -- return [line.split()[0].strip() for line in lines] -+ self.kernel_mods = [line.split()[0].strip() for line in lines] - - def pre_work(self): - # this method will be called before the gathering begins - -From c4182ebd52af523261d2e7ef75affbb88eaf31fb Mon Sep 17 00:00:00 2001 -From: "Bryn M. Reeves" -Date: Mon, 4 Nov 2019 10:45:15 +0000 -Subject: [PATCH 05/10] [Plugin] use correct source path when copying - directories - -Signed-off-by: Bryn M. Reeves ---- - sos/plugins/__init__.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py -index 60fbeaf7..240fe9f1 100644 ---- a/sos/plugins/__init__.py -+++ b/sos/plugins/__init__.py -@@ -725,7 +725,7 @@ class Plugin(object): - if not os.listdir(srcpath): - self.archive.add_dir(dest) - return -- self._copy_dir(dest) -+ self._copy_dir(srcpath) - return - - # handle special nodes (block, char, fifo, socket) --- -2.21.0 - - diff --git a/SOURCES/sos-bz1781148-foreman-psql-dynflow-explicit-cast.patch b/SOURCES/sos-bz1781148-foreman-psql-dynflow-explicit-cast.patch deleted file mode 100644 index c0217ce..0000000 --- a/SOURCES/sos-bz1781148-foreman-psql-dynflow-explicit-cast.patch +++ /dev/null @@ -1,119 +0,0 @@ -From 5fbbc63c5e41eab4fe34e3bb2c76abf26023bd55 Mon Sep 17 00:00:00 2001 -From: Pavel Moravec -Date: Mon, 9 Dec 2019 13:22:34 +0100 -Subject: [PATCH] [foreman] cast dynflow_execution_plans.uuid as varchar - -Due to a change in foreman DB scheme, we must explicitly cast -dynflow_execution_plans.uuid as a varchar since foreman-tasks -0.15.5 . - -The explicit casting works well on older versions as well. - -Resolves: #1882 - -Signed-off-by: Pavel Moravec ---- - sos/plugins/foreman.py | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/sos/plugins/foreman.py b/sos/plugins/foreman.py -index c8ed2850..c1546eae 100644 ---- a/sos/plugins/foreman.py -+++ b/sos/plugins/foreman.py -@@ -176,22 +176,24 @@ class Foreman(Plugin): - dyncmd = ( - 'select dynflow_execution_plans.* from foreman_tasks_tasks join ' - 'dynflow_execution_plans on (foreman_tasks_tasks.external_id = ' -- 'dynflow_execution_plans.uuid) where foreman_tasks_tasks.' -+ 'dynflow_execution_plans.uuid::varchar) where foreman_tasks_tasks.' - 'started_at > NOW() - interval %s' % quote(months) - ) - - dactioncmd = ( - 'select dynflow_actions.* from foreman_tasks_tasks join ' - 'dynflow_actions on (foreman_tasks_tasks.external_id = ' -- 'dynflow_actions.execution_plan_uuid) where foreman_tasks_tasks.' -- 'started_at > NOW() - interval %s' % quote(months) -+ 'dynflow_actions.execution_plan_uuid::varchar) where ' -+ 'foreman_tasks_tasks.started_at > NOW() - interval %s' -+ % quote(months) - ) - - dstepscmd = ( - 'select dynflow_steps.* from foreman_tasks_tasks join ' - 'dynflow_steps on (foreman_tasks_tasks.external_id = ' -- 'dynflow_steps.execution_plan_uuid) where foreman_tasks_tasks.' -- 'started_at > NOW() - interval %s' % quote(months) -+ 'dynflow_steps.execution_plan_uuid::varchar) where ' -+ 'foreman_tasks_tasks.started_at > NOW() - interval %s' -+ % quote(months) - ) - - # Populate this dict with DB queries that should be saved directly as --- -2.21.0 - -From 40cfbd26a64d33cd3ed87edbf8d2b248d339ad9b Mon Sep 17 00:00:00 2001 -From: Pavel Moravec -Date: Thu, 5 Dec 2019 14:26:03 +0100 -Subject: [PATCH] [plugins] improve heuristic for applying --since to - logarchives - -logarchive_pattern treats some configs (e.g. /etc/dbus-1) as log -archives, causing --since option will skip collecting them. - -This patch just improves the heuristic by claiming nothing under /etc -is a logarchive, and adds a warning to sosreport help. - -Improves: #1847 - -Signed-off-by: Pavel Moravec ---- - man/en/sosreport.1 | 7 +++++-- - sos/plugins/__init__.py | 5 ++++- - 2 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/man/en/sosreport.1 b/man/en/sosreport.1 -index a885d563..75819b6e 100644 ---- a/man/en/sosreport.1 -+++ b/man/en/sosreport.1 -@@ -158,8 +158,11 @@ and including logs in non-default locations. This option may significantly - increase the size of reports. - .TP - .B \--since YYYYMMDD[HHMMSS] --Limits the collection to logs newer than this date. --This also affects \--all-logs. Will pad with 0s if HHMMSS isn't specified. -+Limits the collection of log archives to those newer than this date. A log -+archive is any file not found in /etc, that has either a numeric or a -+compression-type file extension for example ".zip". ".1", ".gz" etc.). -+This also affects \--all-logs. The date string will be padded with zeros -+if HHMMSS is not specified. - .TP - .B \--allow-system-changes - Run commands even if they can change the system (e.g. load kernel modules). -diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py -index b7a47b6a..44ae413d 100644 ---- a/sos/plugins/__init__.py -+++ b/sos/plugins/__init__.py -@@ -917,6 +917,7 @@ class Plugin(object): - since = self.get_option('since') - - logarchive_pattern = re.compile(r'.*((\.(zip|gz|bz2|xz))|[-.][\d]+)$') -+ configfile_pattern = re.compile(r"^%s/*" % self.join_sysroot("etc")) - - if not self.test_predicate(pred=pred): - self._log_info("skipped copy spec '%s' due to predicate (%s)" % -@@ -962,7 +963,9 @@ class Plugin(object): - """ When --since is passed, or maxage is coming from the - plugin, we need to filter out older files """ - -- if logarchive_pattern.search(path) is None: -+ # skip config files or not-logarchive files from the filter -+ if ((logarchive_pattern.search(path) is None) or -+ (configfile_pattern.search(path) is not None)): - return True - filetime = datetime.fromtimestamp(getmtime(path)) - if ((since and filetime < since) or --- -2.21.0 - diff --git a/SOURCES/sos-bz1821144-rabbitmq_plugin_tries_docker_exec_for_stopped_containers.patch b/SOURCES/sos-bz1821144-rabbitmq_plugin_tries_docker_exec_for_stopped_containers.patch new file mode 100644 index 0000000..c1c6c50 --- /dev/null +++ b/SOURCES/sos-bz1821144-rabbitmq_plugin_tries_docker_exec_for_stopped_containers.patch @@ -0,0 +1,36 @@ +From e9848da576dde21e1bc22c540d9828a3ea783867 Mon Sep 17 00:00:00 2001 +From: Takashi Kajinami +Date: Mon, 6 Apr 2020 11:20:46 +0900 +Subject: [PATCH] [rabbitmq] Do not run exec for stopped containers + +Currently rabbitmq plugin invokes rabbitmqctl command by docker exec +for all containers whose name start with rabbitmq, but it always tries +to run commands agaist stopped containers, which can never succeed. + +This patch makes sure that the plugin only use running containers, +to avoid useless trial with stopped containers. + +Resolves: #2000 + +Signed-off-by: Takashi Kajinami +Signed-off-by: Jake Hunsaker +--- + sos/plugins/rabbitmq.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sos/plugins/rabbitmq.py b/sos/plugins/rabbitmq.py +index 488040c..9ebf6c0 100644 +--- a/sos/plugins/rabbitmq.py ++++ b/sos/plugins/rabbitmq.py +@@ -23,7 +23,7 @@ class RabbitMQ(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + + def setup(self): + container_status = self.exec_cmd( +- "docker ps -a --format='{{ .Names }}'" ++ "docker ps --format='{{ .Names }}'" + ) + + in_container = False +-- +1.8.3.1 + diff --git a/SOURCES/sos-bz1827555-nfs_merge_nfsserver_to_nfs.patch b/SOURCES/sos-bz1827555-nfs_merge_nfsserver_to_nfs.patch new file mode 100644 index 0000000..ea78cf0 --- /dev/null +++ b/SOURCES/sos-bz1827555-nfs_merge_nfsserver_to_nfs.patch @@ -0,0 +1,119 @@ +From 1ee160b31f08497af7ebbf9c156dd855b70950a9 Mon Sep 17 00:00:00 2001 +From: Jan Jansky +Date: Tue, 19 May 2020 17:38:06 +0200 +Subject: [PATCH] [nfs] merge nfsserver plugin into nfs one + +nfsserver plugin enabledness relies on legacy init scripts. A more +appropriate way to idenfity a NFS server is via nfs-utils package +(though it could be present also on a NFS client). + +As that package enables nfs plugin, it is reasonable to merge the +plugins into one. + +Related: #2073 +Resolves: #2076 +Closes: #2061 + +Signed-off-by: Jan Jansky +Signed-off-by: Jake Hunsaker +--- + sos/plugins/nfs.py | 13 +++++++++++- + sos/plugins/nfsserver.py | 55 ------------------------------------------------ + 2 files changed, 12 insertions(+), 56 deletions(-) + delete mode 100644 sos/plugins/nfsserver.py + +diff --git a/sos/plugins/nfs.py b/sos/plugins/nfs.py +index 833d79a..57074f4 100644 +--- a/sos/plugins/nfs.py ++++ b/sos/plugins/nfs.py +@@ -14,7 +14,7 @@ class Nfs(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + """ + plugin_name = 'nfs' + profiles = ('storage', 'network', 'nfs') +- packages = ['nfs-utils'] ++ packages = ('nfs-utils', ) + + def setup(self): + self.add_copy_spec([ +@@ -24,6 +24,17 @@ class Nfs(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + "/proc/fs/nfsfs/servers", + "/proc/fs/nfsfs/volumes", + "/run/sysconfig/nfs-utils", ++ "/etc/exports", ++ "/etc/exports.d", ++ "/var/lib/nfs/etab", ++ "/var/lib/nfs/xtab", ++ "/var/lib/nfs/rmtab", ++ ]) ++ ++ self.add_cmd_output([ ++ "rpcinfo -p localhost", ++ "nfsstat -o all", ++ "exportfs -v", + ]) + return + +diff --git a/sos/plugins/nfsserver.py b/sos/plugins/nfsserver.py +deleted file mode 100644 +index 3ee08cd..0000000 +--- a/sos/plugins/nfsserver.py ++++ /dev/null +@@ -1,55 +0,0 @@ +-# Copyright (C) 2007 Red Hat, Inc., Eugene Teo +- +-# 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.plugins import Plugin, RedHatPlugin +-import os +-from stat import ST_SIZE +- +- +-class NfsServer(Plugin, RedHatPlugin): +- """NFS server information +- """ +- +- plugin_name = 'nfsserver' +- profiles = ('storage', 'network', 'services', 'nfs') +- +- def check_enabled(self): +- default_runlevel = self.policy.default_runlevel() +- nfs_runlevels = self.policy.runlevel_by_service("nfs") +- if default_runlevel in nfs_runlevels: +- return True +- +- try: +- exports = os.stat("/etc/exports")[ST_SIZE] +- xtab = os.stat("/var/lib/nfs/xtab")[ST_SIZE] +- if exports or xtab: +- return True +- except OSError: +- pass +- +- return False +- +- def setup(self): +- self.add_copy_spec([ +- "/etc/exports", +- "/etc/exports.d", +- "/var/lib/nfs/etab", +- "/var/lib/nfs/xtab", +- "/var/lib/nfs/rmtab" +- ]) +- +- self.add_cmd_output([ +- "rpcinfo -p localhost", +- "nfsstat -o all", +- "exportfs -v" +- ]) +- +- +-# vim: set et ts=4 sw=4 : +-- +1.8.3.1 + diff --git a/SOURCES/sos-bz1840571-rabbitmq_emulate_tty_timeout_foreground.patch b/SOURCES/sos-bz1840571-rabbitmq_emulate_tty_timeout_foreground.patch new file mode 100644 index 0000000..60b25d5 --- /dev/null +++ b/SOURCES/sos-bz1840571-rabbitmq_emulate_tty_timeout_foreground.patch @@ -0,0 +1,34 @@ +From c805cd23b8bd73986f2546a711edd42150d855ba Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Fri, 22 May 2020 12:05:00 +0200 +Subject: [PATCH] [rabbitmq] emulate TTY via timeout foreground + +"docker exec -t" might hang without a terminal. Let emulate TTY via +timeout --foreground instead. + +Resolves: #2083 + +Signed-off-by: Pavel Moravec +Signed-off-by: Jake Hunsaker +--- + sos/plugins/rabbitmq.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sos/plugins/rabbitmq.py b/sos/plugins/rabbitmq.py +index 9ebf6c0..8d9a16f 100644 +--- a/sos/plugins/rabbitmq.py ++++ b/sos/plugins/rabbitmq.py +@@ -38,8 +38,8 @@ class RabbitMQ(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + for container in container_names: + self.add_cmd_output('docker logs {0}'.format(container)) + self.add_cmd_output( +- 'docker exec -t {0} rabbitmqctl report' +- .format(container) ++ 'docker exec {0} rabbitmqctl report' ++ .format(container), foreground=True + ) + else: + self.add_cmd_output("rabbitmqctl report") +-- +1.8.3.1 + diff --git a/SOURCES/sos-bz1856417-gluster-remove_only_dump_files.patch b/SOURCES/sos-bz1856417-gluster-remove_only_dump_files.patch deleted file mode 100644 index b4ac1ac..0000000 --- a/SOURCES/sos-bz1856417-gluster-remove_only_dump_files.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 61a638ba60b30408735e4f65dcfdf7aa6b420449 Mon Sep 17 00:00:00 2001 -From: Jan Jansky -Date: Wed, 15 Jul 2020 15:58:58 +0200 -Subject: [PATCH] [gluster] remove only dump files - -Removes only dump files and leaving -other files as .socket or sock. - -Related: #2152 -Resolves: #2153 - -Signed-off-by: Jan Jansky -Signed-off-by: Jake Hunsaker ---- - sos/plugins/gluster.py | 17 ++++++++--------- - 1 file changed, 8 insertions(+), 9 deletions(-) - -diff --git a/sos/plugins/gluster.py b/sos/plugins/gluster.py ---- a/sos/plugins/gluster.py -+++ b/sos/plugins/gluster.py -@@ -54,15 +54,14 @@ - ret = string.count(last_line, 'DUMP_END_TIME') - - def postproc(self): -- if not os.path.exists(self.statedump_dir): -- return -- try: -- for dirs in os.listdir(self.statedump_dir): -- os.remove(os.path.join(self.statedump_dir, dirs)) -- os.rmdir(self.statedump_dir) -- os.unlink('/tmp/glusterdump.options') -- except OSError: -- pass -+ if self.get_option("dump"): -+ if not os.path.exists(self.statedump_dir): -+ return -+ try: -+ for name in glob.glob(self.statedump_dir + '/*.dump.[0-9]*'): -+ os.remove(name) -+ except OSError: -+ pass - - def setup(self): - self.add_forbidden_path("/var/lib/glusterd/geo-replication/secret.pem") diff --git a/SOURCES/sos-redis_collection_of_redis_from_scl.patch b/SOURCES/sos-redis_collection_of_redis_from_scl.patch new file mode 100644 index 0000000..12ddc1b --- /dev/null +++ b/SOURCES/sos-redis_collection_of_redis_from_scl.patch @@ -0,0 +1,102 @@ +From d90c3b862dfc26578afe5198bf19d70c394d9951 Mon Sep 17 00:00:00 2001 +From: Jan Jansky +Date: Mon, 18 May 2020 12:32:14 +0200 +Subject: [PATCH] [redis] Collection of redis from scl + +As preparation for Satellite 7 configuration and log +collection adding collection of rh-redis32 from scl. + +Resolves: #2074 + +Signed-off-by: Jan Jansky +--- + sos/plugins/redis.py | 52 ++++++++++++++++++++++++++++------------------------ + 1 file changed, 28 insertions(+), 24 deletions(-) + +diff --git a/sos/plugins/redis.py b/sos/plugins/redis.py +index 36d9052..0f01c4e 100644 +--- a/sos/plugins/redis.py ++++ b/sos/plugins/redis.py +@@ -9,17 +9,17 @@ + # + # See the LICENSE file in the source distribution for further information. + +-from sos.plugins import Plugin, RedHatPlugin ++from sos.plugins import Plugin, SCLPlugin + + +-class Redis(Plugin, RedHatPlugin): ++class Redis(Plugin, SCLPlugin): + """Redis, in-memory data structure store + """ + + plugin_name = 'redis' + profiles = ('services',) + +- packages = ('redis',) ++ packages = ('redis', 'rh-redis32', 'rh-redis5') + var_puppet_gen = "/var/lib/config-data/puppet-generated/redis" + files = ( + '/etc/redis.conf', +@@ -35,6 +35,17 @@ class Redis(Plugin, RedHatPlugin): + self.var_puppet_gen + "/etc/security/limits.d/" + ]) + ++ for pkg in self.packages[1:]: ++ scl = pkg.split('rh-redis*-')[0] ++ self.add_copy_spec_scl(scl, [ ++ '/etc/redis.conf', ++ '/etc/redis.conf.puppet', ++ '/etc/redis-sentinel.conf', ++ '/etc/redis-sentinel.conf.puppet', ++ '/var/log/redis/sentinel.log', ++ '/var/log/redis/redis.log' ++ ]) ++ + self.add_cmd_output("redis-cli info") + if self.get_option("all_logs"): + self.add_copy_spec([ +@@ -46,26 +57,19 @@ class Redis(Plugin, RedHatPlugin): + ]) + + def postproc(self): +- self.do_file_sub( +- "/etc/redis.conf", +- r"(masterauth\s).*", +- r"\1********" +- ) +- self.do_file_sub( +- "/etc/redis.conf", +- r"(requirepass\s).*", +- r"\1********" +- ) +- self.do_path_regex_sub( +- self.var_puppet_gen + "/etc/redis.conf*", +- r"(masterauth\s).*", +- r"\1*********" +- ) +- self.do_path_regex_sub( +- self.var_puppet_gen + "/etc/redis.conf*", +- r"(requirepass\s).*", +- r"\1*********" +- ) +- ++ for path in ["/etc/", ++ self.var_puppet_gen + "/etc/", ++ "/etc/opt/rh/rh-redis32/", ++ "/etc/opt/rh/rh-redis5/"]: ++ self.do_file_sub( ++ path + "redis.conf", ++ r"(masterauth\s).*", ++ r"\1********" ++ ) ++ self.do_file_sub( ++ path + "redis.conf", ++ r"(requirepass\s).*", ++ r"requirepass = ********" ++ ) + + # vim: set et ts=4 sw=4 : +-- +1.8.3.1 + diff --git a/SPECS/sos.spec b/SPECS/sos.spec index 50362e1..bb73d92 100644 --- a/SPECS/sos.spec +++ b/SPECS/sos.spec @@ -1,8 +1,8 @@ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Summary: A set of tools to gather troubleshooting information from a system Name: sos -Version: 3.8 -Release: 9%{?dist} +Version: 3.9 +Release: 2%{?dist} Group: Applications/System Source0: https://github.com/sosreport/sos/archive/%{version}.tar.gz License: GPLv2+ @@ -20,15 +20,11 @@ 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 -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-bz1683904-option_to_limit_namespaces.patch -Patch8: sos-bz1856417-gluster-remove_only_dump_files.patch -Patch9: sos-3.8-centos-branding.patch +Patch1: sos-bz1538226-insights_collect_insights_archive_if_available.patch +Patch2: sos-bz1821144-rabbitmq_plugin_tries_docker_exec_for_stopped_containers.patch +Patch3: sos-redis_collection_of_redis_from_scl.patch +Patch4: sos-bz1827555-nfs_merge_nfsserver_to_nfs.patch +Patch5: sos-bz1840571-rabbitmq_emulate_tty_timeout_foreground.patch %description Sos is a set of tools that gathers information about system @@ -42,12 +38,8 @@ support technicians and developers. %patch1 -p1 %patch2 -p1 %patch3 -p1 -%patch4 -p1 +%patch4 -p1 %patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 %build make @@ -71,12 +63,12 @@ rm -rf ${RPM_BUILD_ROOT} %config(noreplace) %{_sysconfdir}/sos.conf %changelog -* Thu Aug 06 2020 CentOS Sources - 3.8-9.el7.centos -- Roll in CentOS Branding +* Wed May 27 2020 Jan Jansky = 3.9-2 +- [rabbitmq] emulate TTY via timeout foreground + Resolves: bz1840571 -* Wed Jul 15 2020 Jan Jansky = 3.8-9 -- [gluster] remove only dump files - Resolves: bz1856417 +* Tue May 19 2020 Jan Jansky = 3.9-1 +- New upstream release sos-3.9 * Mon Feb 24 2020 Jan Jansky = 3.8-8 - Added Obsolete for leapp-repository-sos-plugin to solve