diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c63cd5b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/3.4.tar.gz diff --git a/.sos.metadata b/.sos.metadata new file mode 100644 index 0000000..a550778 --- /dev/null +++ b/.sos.metadata @@ -0,0 +1 @@ +76b088e728d79fa8110d2a16a66ffbc00c7e9170 SOURCES/3.4.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/skip-generating-doc.patch b/SOURCES/skip-generating-doc.patch new file mode 100644 index 0000000..6508f3c --- /dev/null +++ b/SOURCES/skip-generating-doc.patch @@ -0,0 +1,25 @@ +diff -rup a/Makefile b/Makefile +--- a/Makefile 2016-06-29 20:24:47.000000000 +0200 ++++ b/Makefile 2016-06-30 11:10:15.471685702 +0200 +@@ -9,7 +9,7 @@ MINOR := $(shell echo $(VERSION) | cut + RELEASE := $(shell echo `awk '/^Release:/ {gsub(/\%.*/,""); print $2}' sos.spec`) + REPO = https://github.com/sosreport/sos + +-SUBDIRS = po sos sos/plugins sos/policies docs ++SUBDIRS = po sos sos/plugins sos/policies #docs + PYFILES = $(wildcard *.py) + # OS X via brew + # MSGCAT = /usr/local/Cellar/gettext/0.18.1.1/bin/msgcat +@@ -30,9 +30,9 @@ DEB_ARCHIVE_DIR = $(DIST_BUILD_DIR)/$(NA + SRC_BUILD = $(DIST_BUILD_DIR)/sdist + PO_DIR = $(SRC_BUILD)/sos/po + +-.PHONY: docs +-docs: +- make -C docs html man ++#.PHONY: docs ++#docs: ++# make -C docs html man + + build: + for d in $(SUBDIRS); do make -C $$d; [ $$? = 0 ] || exit 1 ; done diff --git a/SOURCES/sos-bz1148381-libvirt-cgroups-collection.patch b/SOURCES/sos-bz1148381-libvirt-cgroups-collection.patch new file mode 100644 index 0000000..d51c8b2 --- /dev/null +++ b/SOURCES/sos-bz1148381-libvirt-cgroups-collection.patch @@ -0,0 +1,29 @@ +From d7af5cddbbb9d93e3af5bff3753d29ff1c02cd8b Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +Date: Mon, 15 May 2017 17:32:06 +0100 +Subject: [PATCH] [libvirt] fix per-process cgroup collection + +The per-pid cgroup data is in a pseudofile named 'cgroup', and not +'cgroups' as in commit 2523ad5. + +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/libvirt.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sos/plugins/libvirt.py b/sos/plugins/libvirt.py +index cbb4fb4..674dd67 100644 +--- a/sos/plugins/libvirt.py ++++ b/sos/plugins/libvirt.py +@@ -65,7 +65,7 @@ class Libvirt(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): + # get details of processes of KVM hosts + for pidfile in glob.glob("/var/run/libvirt/*/*.pid"): + pid = open(pidfile).read().splitlines()[0] +- for pf in ["environ", "cgroups", "maps", "numa_maps", "limits"]: ++ for pf in ["environ", "cgroup", "maps", "numa_maps", "limits"]: + self.add_copy_spec("/proc/%s/%s" % (pid, pf)) + + def postproc(self): +-- +2.7.4 + diff --git a/SOURCES/sos-bz1250346-openstack-tripleo.patch b/SOURCES/sos-bz1250346-openstack-tripleo.patch new file mode 100644 index 0000000..227d360 --- /dev/null +++ b/SOURCES/sos-bz1250346-openstack-tripleo.patch @@ -0,0 +1,239 @@ +From c26ab810bf4b55516a477d96d551f51f0087156c Mon Sep 17 00:00:00 2001 +From: Martin Schuppert +Date: Tue, 2 May 2017 11:56:50 +0200 +Subject: [PATCH] [openstack_*] fix issue with --verify option + +If --verify option got specified, the package list was not handled +properly and resulted in trace. + +Resolves: #1000. + +Signed-off-by: Martin Schuppert +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/openstack_ceilometer.py | 2 +- + sos/plugins/openstack_cinder.py | 2 +- + sos/plugins/openstack_glance.py | 2 +- + sos/plugins/openstack_heat.py | 2 +- + sos/plugins/openstack_horizon.py | 2 +- + sos/plugins/openstack_instack.py | 2 +- + sos/plugins/openstack_ironic.py | 2 +- + sos/plugins/openstack_keystone.py | 2 +- + sos/plugins/openstack_neutron.py | 2 +- + sos/plugins/openstack_nova.py | 2 +- + sos/plugins/openstack_sahara.py | 2 +- + sos/plugins/openstack_swift.py | 2 +- + sos/plugins/openstack_trove.py | 2 +- + 13 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/sos/plugins/openstack_ceilometer.py b/sos/plugins/openstack_ceilometer.py +index 94b73b6..571723c 100644 +--- a/sos/plugins/openstack_ceilometer.py ++++ b/sos/plugins/openstack_ceilometer.py +@@ -38,7 +38,7 @@ class OpenStackCeilometer(Plugin): + sizelimit=self.limit) + self.add_copy_spec("/etc/ceilometer/") + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + def postproc(self): + protect_keys = [ +diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py +index 157f23d..a46dd56 100644 +--- a/sos/plugins/openstack_cinder.py ++++ b/sos/plugins/openstack_cinder.py +@@ -45,7 +45,7 @@ class OpenStackCinder(Plugin): + self.add_copy_spec("/var/log/cinder/*.log", sizelimit=self.limit) + + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + def postproc(self): + protect_keys = [ +diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py +index e18be9c..0db5025 100644 +--- a/sos/plugins/openstack_glance.py ++++ b/sos/plugins/openstack_glance.py +@@ -45,7 +45,7 @@ class OpenStackGlance(Plugin): + self.add_copy_spec("/etc/glance/") + + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + vars = [p in os.environ for p in [ + 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py +index c002bbd..3638aa3 100644 +--- a/sos/plugins/openstack_heat.py ++++ b/sos/plugins/openstack_heat.py +@@ -52,7 +52,7 @@ class OpenStackHeat(Plugin): + self.add_copy_spec("/etc/heat/") + + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + def postproc(self): + protect_keys = [ +diff --git a/sos/plugins/openstack_horizon.py b/sos/plugins/openstack_horizon.py +index 25a9916..88ed910 100644 +--- a/sos/plugins/openstack_horizon.py ++++ b/sos/plugins/openstack_horizon.py +@@ -40,7 +40,7 @@ class OpenStackHorizon(Plugin): + self.add_forbidden_path("*.py[co]") + + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + def postproc(self): + protect_keys = [ +diff --git a/sos/plugins/openstack_instack.py b/sos/plugins/openstack_instack.py +index 30acecf..3cbc008 100644 +--- a/sos/plugins/openstack_instack.py ++++ b/sos/plugins/openstack_instack.py +@@ -30,7 +30,7 @@ class OpenStackInstack(Plugin): + self.add_copy_spec("/home/stack/instackenv.json") + self.add_copy_spec("/home/stack/undercloud.conf") + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +diff --git a/sos/plugins/openstack_ironic.py b/sos/plugins/openstack_ironic.py +index 760ca43..6a75124 100644 +--- a/sos/plugins/openstack_ironic.py ++++ b/sos/plugins/openstack_ironic.py +@@ -38,7 +38,7 @@ class OpenStackIronic(Plugin): + self.add_cmd_output('ls -laRt /var/lib/ironic/') + + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + vars = [p in os.environ for p in [ + 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +diff --git a/sos/plugins/openstack_keystone.py b/sos/plugins/openstack_keystone.py +index ce177fb..e7cda2f 100644 +--- a/sos/plugins/openstack_keystone.py ++++ b/sos/plugins/openstack_keystone.py +@@ -42,7 +42,7 @@ class OpenStackKeystone(Plugin): + self.add_copy_spec("/var/log/keystone/*.log", sizelimit=self.limit) + + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + vars = [p in os.environ for p in [ + 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +diff --git a/sos/plugins/openstack_neutron.py b/sos/plugins/openstack_neutron.py +index 590194c..8cf7357 100644 +--- a/sos/plugins/openstack_neutron.py ++++ b/sos/plugins/openstack_neutron.py +@@ -36,7 +36,7 @@ class OpenStackNeutron(Plugin): + self.add_copy_spec("/etc/neutron/") + self.add_copy_spec("/var/lib/neutron/") + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + vars = [p in os.environ for p in [ + 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py +index 8e0a19a..14bdfbd 100644 +--- a/sos/plugins/openstack_nova.py ++++ b/sos/plugins/openstack_nova.py +@@ -70,7 +70,7 @@ class OpenStackNova(Plugin): + self.add_copy_spec("/etc/nova/") + + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + def postproc(self): + protect_keys = [ +diff --git a/sos/plugins/openstack_sahara.py b/sos/plugins/openstack_sahara.py +index 5a2a5c3..cbc5bd9 100644 +--- a/sos/plugins/openstack_sahara.py ++++ b/sos/plugins/openstack_sahara.py +@@ -37,7 +37,7 @@ class OpenStackSahara(Plugin): + self.add_copy_spec("/var/log/sahara/*.log", sizelimit=self.limit) + + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + def postproc(self): + protect_keys = [ +diff --git a/sos/plugins/openstack_swift.py b/sos/plugins/openstack_swift.py +index 1ac3509..6edc056 100644 +--- a/sos/plugins/openstack_swift.py ++++ b/sos/plugins/openstack_swift.py +@@ -38,7 +38,7 @@ class OpenStackSwift(Plugin): + self.add_copy_spec("/etc/swift/") + + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + def postproc(self): + protect_keys = [ +diff --git a/sos/plugins/openstack_trove.py b/sos/plugins/openstack_trove.py +index e8306e5..539cbb3 100644 +--- a/sos/plugins/openstack_trove.py ++++ b/sos/plugins/openstack_trove.py +@@ -37,7 +37,7 @@ class OpenStackTrove(Plugin): + self.add_copy_spec('/etc/trove/') + + if self.get_option("verify"): +- self.add_cmd_output("rpm -V %s" % ' '.join(packages)) ++ self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + def postproc(self): + +-- +2.7.4 + +From 02b95e468211406989fd488e649f99bf9e9dfc1c Mon Sep 17 00:00:00 2001 +From: Martin Schuppert +Date: Tue, 2 May 2017 12:14:47 +0200 +Subject: [PATCH] [openstack_instack] extended packages list + +Extended packages list to verify triplo packages if --verify is +specified. + +Resolves: #1001. + +Signed-off-by: Martin Schuppert +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/openstack_instack.py | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/sos/plugins/openstack_instack.py b/sos/plugins/openstack_instack.py +index 3cbc008..bd836ba 100644 +--- a/sos/plugins/openstack_instack.py ++++ b/sos/plugins/openstack_instack.py +@@ -114,6 +114,15 @@ class RedHatRDOManager(OpenStackInstack, RedHatPlugin): + packages = [ + 'instack', + 'instack-undercloud', ++ 'openstack-tripleo', ++ 'openstack-tripleo-common', ++ 'openstack-tripleo-heat-templates', ++ 'openstack-tripleo-image-elements', ++ 'openstack-tripleo-puppet-elements', ++ 'openstack-tripleo-ui', ++ 'openstack-tripleo-validations', ++ 'puppet-tripleo', ++ 'python-tripleoclient' + ] + + def setup(self): +-- +2.7.4 + diff --git a/SOURCES/sos-bz1393961-missing-filesystem-nonfatal.patch b/SOURCES/sos-bz1393961-missing-filesystem-nonfatal.patch new file mode 100644 index 0000000..03b5c7b --- /dev/null +++ b/SOURCES/sos-bz1393961-missing-filesystem-nonfatal.patch @@ -0,0 +1,60 @@ +From 4df4897146d4f2a0589a8b32532f912f1ea2ed8c Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +Date: Mon, 22 May 2017 16:30:35 +0100 +Subject: [PATCH] [policies/redhat] make missing 'filesystem' package non-fatal + +On Red Hat systems, we use the version of the installed filesystem' +package to enable handling of UsrMove[1] in the PATH used when +running commands from sos. + +If the package is not present (e.g. because of a broken system +configuration, rpm timeout, corrupt database or other cause), +previous versions would fail immediately. In this situation +there was no way for the user to attempt a complete run (short +of fixing the problem related to the 'filesystem' package). + +Now that the timeout has been lengthened for this command, make +the UsrMove determination a bit more robust to prevent users from +being unable to run sos at all: + + - If RPM fails entirely, exit (plugin enablement tests will fail) + - If RPM succeeds but 'filesystem' is missing assume UsrMove + (this is true for all supported Red Hat distros today) + - Otherwise apply the normal PATH logic. + +Signed-off-by: Bryn M. Reeves +--- + sos/policies/redhat.py | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py +index b801b5e..ec1d974 100644 +--- a/sos/policies/redhat.py ++++ b/sos/policies/redhat.py +@@ -58,13 +58,21 @@ class RedHatPolicy(LinuxPolicy): + + pkgs = self.package_manager.all_pkgs() + +- # If rpm query timed out after timeout duration exit ++ # If rpm query failed, exit + if not pkgs: + print("Could not obtain installed package list", file=sys.stderr) + sys.exit(1) + + # handle PATH for UsrMove +- if pkgs['filesystem']['version'][0] == '3': ++ if 'filesystem' not in pkgs: ++ print("Could not find 'filesystem' package: " ++ "assuming PATH settings") ++ usrmove = True ++ else: ++ filesys_version = pkgs['filesystem']['version'] ++ usrmove = True if filesys_version[0] == '3' else False ++ ++ if usrmove: + self.PATH = "/usr/sbin:/usr/bin:/root/bin" + else: + self.PATH = "/sbin:/bin:/usr/sbin:/usr/bin:/root/bin" +-- +2.7.4 + diff --git a/SOURCES/sos-bz1400407-samba-dc-connect.patch b/SOURCES/sos-bz1400407-samba-dc-connect.patch new file mode 100644 index 0000000..f353560 --- /dev/null +++ b/SOURCES/sos-bz1400407-samba-dc-connect.patch @@ -0,0 +1,26 @@ +From ca831062bafa88f5be651d2cf6c8afd2162dea04 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?G=C3=BCnther=20Deschner?= +Date: Mon, 29 May 2017 15:47:29 +0200 +Subject: [PATCH] [samba] Fix dc-connect winbind logfile path + +Guenther + +Signed-off-by: Guenther Deschner +--- + sos/plugins/samba.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sos/plugins/samba.py b/sos/plugins/samba.py +index 377eb889..dfe01d49 100644 +--- a/sos/plugins/samba.py ++++ b/sos/plugins/samba.py +@@ -35,7 +35,7 @@ def setup(self): + self.add_copy_spec("/var/log/samba/log.winbindd", sizelimit=self.limit) + self.add_copy_spec("/var/log/samba/log.winbindd-idmap", + sizelimit=self.limit) +- self.add_copy_spec("/var/log/samba/log.winbindd-dc-connet", ++ self.add_copy_spec("/var/log/samba/log.winbindd-dc-connect", + sizelimit=self.limit) + self.add_copy_spec("/var/log/samba/log.wb-*", sizelimit=self.limit) + + diff --git a/SOURCES/sos-bz1416535-pacemaker-user-logs.patch b/SOURCES/sos-bz1416535-pacemaker-user-logs.patch new file mode 100644 index 0000000..fc6e37f --- /dev/null +++ b/SOURCES/sos-bz1416535-pacemaker-user-logs.patch @@ -0,0 +1,123 @@ +From 17809273cecd83c068931e5d7e73d126d98e6ac1 Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +Date: Tue, 9 May 2017 14:34:13 +0100 +Subject: [PATCH 1/2] [pacemaker] Collect /etc/default/pacemaker for + Debian/Ubuntu + +Make /etc/default/pacemaker the default location for the Pacemaker +defaults file, and have the RedHatPlugin override this to the +/etc/sysconfig/pacemaker location as required. + +Signed-off-by: Pavel Moravec +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/pacemaker.py | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/sos/plugins/pacemaker.py b/sos/plugins/pacemaker.py +index 0dac1da..74de433 100644 +--- a/sos/plugins/pacemaker.py ++++ b/sos/plugins/pacemaker.py +@@ -17,12 +17,13 @@ from datetime import datetime, timedelta + import re + + +-class Pacemaker(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): ++class Pacemaker(Plugin, DebianPlugin, UbuntuPlugin): + """HA Cluster resource manager""" + + plugin_name = "pacemaker" + profiles = ("cluster", ) + packages = ["pacemaker"] ++ defaults = "/etc/default/pacemaker" + + option_list = [ + ("crm_from", "specify the start time for crm_report", "fast", False), +@@ -32,7 +33,7 @@ class Pacemaker(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + def setup(self): + self.add_copy_spec([ + "/var/lib/pacemaker/cib/cib.xml", +- "/etc/sysconfig/pacemaker", ++ self.defaults, + "/var/log/pacemaker.log", + "/var/log/pcsd/pcsd.log" + ]) +@@ -76,4 +77,13 @@ class Pacemaker(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + r"\1********" + ) + ++ ++class RedHatPacemaker(Pacemaker, RedHatPlugin): ++ """ Handle alternate location of pacemaker defaults file. ++ """ ++ def setup(self): ++ self.defaults = "/etc/sysconfig/pacemaker" ++ super(RedHatPacemaker, self).setup() ++ ++ + # vim: et ts=4 sw=4 +-- +2.7.4 + + +From 15b01889292ee3fca68ea76523be93af3be138f6 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Wed, 3 May 2017 09:48:29 +0200 +Subject: [PATCH 2/2] [pacemaker] Collect user-defined logfile + +/etc/sysconfig/pacemaker or /etc/default/pacemaker can specify pacemaker's +logfile that sos should collect. + +Resolves: #1002. + +Signed-off-by: Pavel Moravec +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/pacemaker.py | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/sos/plugins/pacemaker.py b/sos/plugins/pacemaker.py +index 74de433..9393831 100644 +--- a/sos/plugins/pacemaker.py ++++ b/sos/plugins/pacemaker.py +@@ -15,6 +15,7 @@ + from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin + from datetime import datetime, timedelta + import re ++import os.path + + + class Pacemaker(Plugin, DebianPlugin, UbuntuPlugin): +@@ -45,6 +46,7 @@ class Pacemaker(Plugin, DebianPlugin, UbuntuPlugin): + "pcs status", + "pcs property list --all" + ]) ++ + # crm_report needs to be given a --from "YYYY-MM-DD HH:MM:SS" start + # time in order to collect data. + crm_from = (datetime.today() - +@@ -70,6 +72,21 @@ class Pacemaker(Plugin, DebianPlugin, UbuntuPlugin): + (crm_scrub, crm_dest, crm_from), + chroot=self.tmp_in_sysroot()) + ++ # collect user-defined logfiles, matching pattern: ++ # PCMK_loggfile=filename ++ # specified in the pacemaker defaults file. ++ pattern = '^\s*PCMK_logfile=[\'\"]?(\S+)[\'\"]?\s*(\s#.*)?$' ++ if os.path.isfile(self.defaults): ++ with open(self.defaults) as f: ++ for line in f: ++ if re.match(pattern, line): ++ # remove trailing and leading quote marks, in case the ++ # line is e.g. PCMK_logfile="/var/log/pacemaker.log" ++ logfile = re.search(pattern, line).group(1) ++ for regexp in [r'^"', r'"$', r'^\'', r'\'$']: ++ logfile = re.sub(regexp, '', logfile) ++ self.add_copy_spec(logfile) ++ + def postproc(self): + self.do_cmd_output_sub( + "pcs config", +-- +2.7.4 + diff --git a/SOURCES/sos-bz1438257-collect-cmds-with-return-1.patch b/SOURCES/sos-bz1438257-collect-cmds-with-return-1.patch new file mode 100644 index 0000000..973f551 --- /dev/null +++ b/SOURCES/sos-bz1438257-collect-cmds-with-return-1.patch @@ -0,0 +1,35 @@ +From a2c387ae1687170e827e0aa2b49faf759c015798 Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +Date: Wed, 19 Apr 2017 14:22:50 +0100 +Subject: [PATCH] [Pugin] revert 77eb4ab (do not return output from failed + commands) + +Revert this commit: individual plugins must test the command +status (if they care): plugins that attempt to access command +output without testing command status are buggy and need to be +fixed. + +Resolves: #986. + +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/__init__.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py +index 5286e4b..35edcb1 100644 +--- a/sos/plugins/__init__.py ++++ b/sos/plugins/__init__.py +@@ -692,9 +692,6 @@ class Plugin(object): + if result['status'] == 126 or result['status'] == 127: + return None + +- if result['status'] == 1: +- return None +- + self._log_debug("collected output of '%s' in %s" + % (exe.split()[0], time() - start)) + +-- +2.7.4 + diff --git a/SOURCES/sos-bz1438269-ceph-collect-etc-calamari.patch b/SOURCES/sos-bz1438269-ceph-collect-etc-calamari.patch new file mode 100644 index 0000000..e3901c5 --- /dev/null +++ b/SOURCES/sos-bz1438269-ceph-collect-etc-calamari.patch @@ -0,0 +1,40 @@ +From 44f3e7332516f09738dc865e943eb70eceb50553 Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +Date: Thu, 20 Apr 2017 16:19:46 +0100 +Subject: [PATCH] [ceph] fix list formatting + +Fix the formatting of the add_copy_spec() lists in ceph: make the +first conform to the sos bracing and indenting rules for lists in +argument tuples, and fix a missing comma in the second. + +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/ceph.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/sos/plugins/ceph.py b/sos/plugins/ceph.py +index 06b8605..afb6e24 100644 +--- a/sos/plugins/ceph.py ++++ b/sos/plugins/ceph.py +@@ -40,7 +40,8 @@ class Ceph(Plugin, RedHatPlugin, UbuntuPlugin): + self.add_copy_spec([ + "/var/log/ceph/*.log", + "/var/log/radosgw/*.log", +- "/var/log/calamari/*.log"], sizelimit=limit) ++ "/var/log/calamari/*.log" ++ ], sizelimit=limit) + else: + self.add_copy_spec([ + "/var/log/ceph/", +@@ -50,7 +51,7 @@ class Ceph(Plugin, RedHatPlugin, UbuntuPlugin): + + self.add_copy_spec([ + "/etc/ceph/", +- "/etc/calamari/" ++ "/etc/calamari/", + "/var/lib/ceph/", + "/var/run/ceph/" + ]) +-- +2.7.4 + diff --git a/SOURCES/sos-bz1442078-container-test-oci.patch b/SOURCES/sos-bz1442078-container-test-oci.patch new file mode 100644 index 0000000..3b01b8f --- /dev/null +++ b/SOURCES/sos-bz1442078-container-test-oci.patch @@ -0,0 +1,180 @@ +From 471d8e86c3c174f7b075c306542c732f30893281 Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +Date: Wed, 3 May 2017 16:39:25 +0100 +Subject: [PATCH 1/3] [reporting] imrove readability of Six string workaround + +Improve the readability of the changes to work around Six issue +emphasise the fact that the buffer contains line oriented data, +and introduce a helper function to test whether the string needs +the workaround to be applied or not: this shortens the list +comprehension which would otherwise overflow a single line due +to the longer buffer variable name. + +Signed-off-by: Bryn M. Reeves +--- + sos/reporting.py | 25 ++++++++++++++++++------- + 1 file changed, 18 insertions(+), 7 deletions(-) + +diff --git a/sos/reporting.py b/sos/reporting.py +index 0bb7d29..a4941ad 100644 +--- a/sos/reporting.py ++++ b/sos/reporting.py +@@ -118,6 +118,17 @@ class Note(Leaf): + self.data = content + + ++def ends_bs(string): ++ """ Return True if 'string' ends with a backslash, and False otherwise. ++ ++ Define this as a named function for no other reason than that pep8 ++ now forbids binding of a lambda expression to a name: ++ ++ 'E731 do not assign a lambda expression, use a def' ++ """ ++ return string.endswith('\\') ++ ++ + class PlainTextReport(object): + """Will generate a plain text report from a top_level Report object""" + +@@ -134,16 +145,16 @@ class PlainTextReport(object): + (Note, NOTE, "- notes:"), + ) + +- buf = [] ++ line_buf = [] + + def __init__(self, report_node): + self.report_node = report_node + + def unicode(self): +- self.buf = buf = [] ++ self.line_buf = line_buf = [] + for section_name, section_contents in sorted(iteritems( + self.report_node.data)): +- buf.append(section_name + "\n" + self.DIVIDER) ++ line_buf.append(section_name + "\n" + self.DIVIDER) + for type_, format_, header in self.subsections: + self.process_subsection(section_contents, type_.ADDS_TO, + header, format_) +@@ -151,10 +162,10 @@ class PlainTextReport(object): + # Workaround python.six mishandling of strings ending in '/' by + # adding a single space following any '\' at end-of-line. + # See Six issue #60. +- buf = [(val + " ") if val.endswith('\\') else val for val in buf] ++ line_buf = [line + " " if ends_bs(line) else line for line in line_buf] + + output = u'\n'.join(map(lambda i: (i if isinstance(i, six.text_type) +- else six.u(i)), buf)) ++ else six.u(i)), line_buf)) + if six.PY3: + return output + else: +@@ -162,8 +173,8 @@ class PlainTextReport(object): + + def process_subsection(self, section, key, header, format_): + if key in section: +- self.buf.append(header) ++ self.line_buf.append(header) + for item in section.get(key): +- self.buf.append(format_ % item) ++ self.line_buf.append(format_ % item) + + # vim: set et ts=4 sw=4 : +-- +2.7.4 + + +From a81243cdd3f0e7db152251caeb478c19cd801277 Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +Date: Wed, 3 May 2017 16:42:10 +0100 +Subject: [PATCH 2/3] [plugins] work around Six string problems in HTML reports + +A workaround for Six string encoding problems involving strings +that end in '\' characters was introduced for plain text reports +in commit 3d23564: a similar fix is also needed for HTML reports, +since the same string encoding problem can occur there too: + +> /usr/lib/python2.7/site-packages/six.py(647)u() +-> return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape") +(Pdb) bt + /usr/sbin/sosreport(25)() +-> main(sys.argv[1:]) + /usr/lib/python2.7/site-packages/sos/sosreport.py(1632)main() +-> sos.execute() + /usr/lib/python2.7/site-packages/sos/sosreport.py(1606)execute() +-> self.html_report() + /usr/lib/python2.7/site-packages/sos/sosreport.py(1373)html_report() +-> self._html_report() + /usr/lib/python2.7/site-packages/sos/sosreport.py(1434)_html_report() +-> self.handle_exception() + /usr/lib/python2.7/site-packages/sos/sosreport.py(1432)_html_report() +-> html = plug.report() + /usr/lib/python2.7/site-packages/sos/plugins/__init__.py(930)report() +-> + "/" + _to_u(cmd['file']) + /usr/lib/python2.7/site-packages/sos/plugins/__init__.py(44)_to_u() +-> s = six.u(s) +> /usr/lib/python2.7/site-packages/six.py(647)u() +-> return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape") + +Avoid this by applying the same workaround ('\$' -> '\ $') in the +existing Plugin _to_u() helper function. + +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/__init__.py | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py +index 49da6f2..cd34d19 100644 +--- a/sos/plugins/__init__.py ++++ b/sos/plugins/__init__.py +@@ -36,6 +36,11 @@ from six.moves import zip, filter + + def _to_u(s): + if not isinstance(s, six.text_type): ++ # Workaround python.six mishandling of strings ending in '\' by ++ # adding a single space following any '\' at end-of-line. ++ # See Six issue #60. ++ if s.endswith('\\'): ++ s += " " + s = six.u(s) + return s + +-- +2.7.4 + + +From 5e3ae1cf78cbd7dd122ed229add39e89aefdc21e Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +Date: Wed, 3 May 2017 16:47:04 +0100 +Subject: [PATCH 3/3] [policies/redhat] accept 'oci' as a valid container type + +Currently the Red Hat container policy accepts 'container=docker' +as a valid indication that we are running in a container and to +enable sysroot and host sysroot checks. + +More recent Red Hat container infrastructure has change to setting +'container=oci', so recognise this value as well. + +Signed-off-by: Bryn M. Reeves +--- + sos/policies/redhat.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py +index a1565c6..a6e3712 100644 +--- a/sos/policies/redhat.py ++++ b/sos/policies/redhat.py +@@ -84,7 +84,7 @@ class RedHatPolicy(LinuxPolicy): + specific initialisation based on ENV_HOST_SYSROOT. + """ + if ENV_CONTAINER in os.environ: +- if os.environ[ENV_CONTAINER] == 'docker': ++ if os.environ[ENV_CONTAINER] in ['docker', 'oci']: + self._in_container = True + if ENV_HOST_SYSROOT in os.environ: + self._host_sysroot = os.environ[ENV_HOST_SYSROOT] +-- +2.7.4 + diff --git a/SOURCES/sos-bz1444641-virsh-uncaught-exception.patch b/SOURCES/sos-bz1444641-virsh-uncaught-exception.patch new file mode 100644 index 0000000..34abe2f --- /dev/null +++ b/SOURCES/sos-bz1444641-virsh-uncaught-exception.patch @@ -0,0 +1,50 @@ +From 3b41178154354277efc2f42a425904f32cef2c66 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Sun, 23 Apr 2017 20:41:52 +0200 +Subject: [PATCH] [virsh] Handle properly cases when virsh commands fail + +When parsing output of "virsh -r *" commands, handle properly cases +when either command fails - do not parse the output then. + +Resolves: #997 + +Signed-off-by: Pavel Moravec +--- + sos/plugins/virsh.py | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/sos/plugins/virsh.py b/sos/plugins/virsh.py +index bc0a35f..4150522 100644 +--- a/sos/plugins/virsh.py ++++ b/sos/plugins/virsh.py +@@ -52,10 +52,10 @@ class LibvirtClient(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): + # get network, pool and nwfilter elements + for k in ['net', 'nwfilter', 'pool']: + self.add_cmd_output('%s %s-list' % (cmd, k)) +- k_file = self.get_cmd_output_now('%s %s-list' % (cmd, k)) +- if k_file: +- k_lines = open(k_file, 'r').read().splitlines() +- # the 'name' column position changes between virsh cmds ++ k_list = self.get_command_output('%s %s-list' % (cmd, k)) ++ if k_list and k_list['status'] == 0: ++ k_lines = k_list['output'].splitlines() ++ # the 'Name' column position changes between virsh cmds + pos = k_lines[0].split().index('Name') + for j in filter(lambda x: x, k_lines[2:]): + n = j.split()[pos] +@@ -63,9 +63,9 @@ class LibvirtClient(Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin): + + # cycle through the VMs/domains list, ignore 2 header lines and latest + # empty line, and dumpxml domain name in 2nd column +- domains_file = self.get_cmd_output_now('%s list --all' % cmd) +- if domains_file: +- domains_lines = open(domains_file, "r").read().splitlines()[2:] ++ domains_output = self.get_command_output('%s list --all' % cmd) ++ if domains_output and domains_output['status'] == 0: ++ domains_lines = domains_output['output'].splitlines()[2:] + for domain in filter(lambda x: x, domains_lines): + d = domain.split()[1] + for x in ['dumpxml', 'dominfo', 'domblklist']: +-- +2.7.4 + diff --git a/SOURCES/sos-bz1449904-ceph-tmp-mount-exclude.patch b/SOURCES/sos-bz1449904-ceph-tmp-mount-exclude.patch new file mode 100644 index 0000000..c47ea8d --- /dev/null +++ b/SOURCES/sos-bz1449904-ceph-tmp-mount-exclude.patch @@ -0,0 +1,37 @@ +From 7da0d24619928690f4999ffc1693b643b612f130 Mon Sep 17 00:00:00 2001 +From: Tomas Petr +Date: Thu, 11 May 2017 11:16:33 +0200 +Subject: [PATCH] [ceph] exclude temporary mount locations from collection + +Do not collect temporary mount paths at /var/lib/ceph/tmp/mnt.XXXX. + +Resolves #1006 +Replaces #1005 + +Signed-off-by: Tomas Petr +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/ceph.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/sos/plugins/ceph.py b/sos/plugins/ceph.py +index 1be7fd9..0b375d1 100644 +--- a/sos/plugins/ceph.py ++++ b/sos/plugins/ceph.py +@@ -81,6 +81,13 @@ class Ceph(Plugin, RedHatPlugin, UbuntuPlugin): + self.add_forbidden_path("/var/lib/ceph/*/*/*keyring*") + self.add_forbidden_path("/var/lib/ceph/osd/*") + self.add_forbidden_path("/var/lib/ceph/mon/*") ++ ++# Excludes temporary ceph-osd mount location like ++# /var/lib/ceph/tmp/mnt.XXXX from sos collection. ++# In the /var/lib/ceph/tmp/ can still other files of potential ++# interest exists, so exclude only known temporary mount locations. ++ ++ self.add_forbidden_path("/var/lib/ceph/tmp/*mnt*") + self.add_forbidden_path("/etc/ceph/*bindpass*") + + # vim: set et ts=4 sw=4 : +-- +2.7.4 + diff --git a/SOURCES/sos-bz1463635-openstack-containerized-tripleo.patch b/SOURCES/sos-bz1463635-openstack-containerized-tripleo.patch new file mode 100644 index 0000000..332e32b --- /dev/null +++ b/SOURCES/sos-bz1463635-openstack-containerized-tripleo.patch @@ -0,0 +1,1533 @@ +From 665b85fcf25c016cbb467f8d9e3e93c2005b0fb9 Mon Sep 17 00:00:00 2001 +From: Bogdan Dobrelya +Date: Wed, 28 Jun 2017 21:34:39 +0200 +Subject: [PATCH] [plugins] Tripleo specific containerized services logs + (#1046) + +Add Tripleo Pike opinionated logs paths to be collected +for services, when running in containers. This is a temporary +and will be reworked for Queens, like switching those to syslog +or fluentd shipping logs to Elasticsearch cluster. + +Partial bug: https://bugs.launchpad.net/tripleo/+bug/1700909 +Related blueprint: https://review.openstack.org/#/c/462900 + +Signed-off-by: Bogdan Dobrelya +Signed-off-by: Adam Stokes +--- + sos/plugins/mongodb.py | 3 ++- + sos/plugins/mysql.py | 2 ++ + sos/plugins/openstack_ceilometer.py | 7 +++++-- + sos/plugins/openstack_cinder.py | 8 ++++++-- + sos/plugins/openstack_glance.py | 8 ++++++-- + sos/plugins/openstack_heat.py | 8 ++++++-- + sos/plugins/openstack_horizon.py | 8 ++++++-- + sos/plugins/openstack_instack.py | 12 ++++++++---- + sos/plugins/openstack_ironic.py | 8 ++++++-- + sos/plugins/openstack_keystone.py | 8 ++++++-- + sos/plugins/openstack_manila.py | 6 ++++-- + sos/plugins/openstack_neutron.py | 8 ++++++-- + sos/plugins/openstack_nova.py | 8 ++++++-- + sos/plugins/openstack_sahara.py | 8 ++++++-- + sos/plugins/openstack_swift.py | 8 ++++++-- + sos/plugins/openstack_trove.py | 8 ++++++-- + sos/plugins/pacemaker.py | 3 ++- + sos/plugins/rabbitmq.py | 3 ++- + sos/plugins/redis.py | 6 ++++-- + 19 files changed, 95 insertions(+), 35 deletions(-) + +diff --git a/sos/plugins/mongodb.py b/sos/plugins/mongodb.py +index 5d7d601..46b0251 100644 +--- a/sos/plugins/mongodb.py ++++ b/sos/plugins/mongodb.py +@@ -30,7 +30,8 @@ class MongoDb(Plugin, DebianPlugin, UbuntuPlugin): + def setup(self): + self.add_copy_spec([ + "/etc/mongodb.conf", +- "/var/log/mongodb/mongodb.log" ++ "/var/log/mongodb/mongodb.log", ++ "/var/log/containers/mongodb/mongodb.log" + ]) + + def postproc(self): +diff --git a/sos/plugins/mysql.py b/sos/plugins/mysql.py +index b750ed3..7bf933a 100644 +--- a/sos/plugins/mysql.py ++++ b/sos/plugins/mysql.py +@@ -40,12 +40,14 @@ class Mysql(Plugin): + # Required for MariaDB under pacemaker (MariaDB-Galera) + "/var/log/mysqld.log", + "/var/log/mysql/mysqld.log", ++ "/var/log/containers/mysql/mysqld.log", + "/var/log/mariadb/mariadb.log", + ]) + + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/mysql*", ++ "/var/log/containers/mysql*", + "/var/log/mariadb*" + ]) + +diff --git a/sos/plugins/openstack_ceilometer.py b/sos/plugins/openstack_ceilometer.py +index 8e3e8e9..2c3a809 100644 +--- a/sos/plugins/openstack_ceilometer.py ++++ b/sos/plugins/openstack_ceilometer.py +@@ -32,9 +32,12 @@ class OpenStackCeilometer(Plugin): + # Ceilometer + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/ceilometer/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/ceilometer/", ++ "/var/log/containers/ceilometer/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/ceilometer/*.log", ++ self.add_copy_spec(["/var/log/ceilometer/*.log", ++ "/var/log/containers/ceilometer/*.log"], + sizelimit=self.limit) + self.add_copy_spec("/etc/ceilometer/") + if self.get_option("verify"): +diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py +index 0383a8a..ffec62b 100644 +--- a/sos/plugins/openstack_cinder.py ++++ b/sos/plugins/openstack_cinder.py +@@ -40,9 +40,13 @@ class OpenStackCinder(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/cinder/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/cinder/", ++ "/var/log/containers/cinder/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/cinder/*.log", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/cinder/*.log", ++ "/var/log/containers/cinder/*.log"], ++ sizelimit=self.limit) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py +index 1aa0cb7..88d06e3 100644 +--- a/sos/plugins/openstack_glance.py ++++ b/sos/plugins/openstack_glance.py +@@ -38,9 +38,13 @@ class OpenStackGlance(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/glance/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/glance/", ++ "/var/log/containers/glance/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/glance/*.log", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/glance/*.log", ++ "/var/log/containers/glance/*.log"], ++ sizelimit=self.limit) + + self.add_copy_spec("/etc/glance/") + +diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py +index 451bad3..2dad83f 100644 +--- a/sos/plugins/openstack_heat.py ++++ b/sos/plugins/openstack_heat.py +@@ -45,9 +45,13 @@ class OpenStackHeat(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/heat/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/heat/", ++ "/var/log/containers/heat/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/heat/*.log", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/heat/*.log", ++ "/var/log/containers/heat/*.log"], ++ sizelimit=self.limit) + + self.add_copy_spec("/etc/heat/") + +diff --git a/sos/plugins/openstack_horizon.py b/sos/plugins/openstack_horizon.py +index f778b91..75ad3ce 100644 +--- a/sos/plugins/openstack_horizon.py ++++ b/sos/plugins/openstack_horizon.py +@@ -32,9 +32,13 @@ class OpenStackHorizon(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/horizon/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/horizon/", ++ "/var/log/containers/horizon/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/horizon/*.log", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/horizon/*.log", ++ "/var/log/containers/horizon/*.log"], ++ sizelimit=self.limit) + + self.add_copy_spec("/etc/openstack-dashboard/") + self.add_forbidden_path("*.py[co]") +diff --git a/sos/plugins/openstack_instack.py b/sos/plugins/openstack_instack.py +index 3c87de8..87ec59f 100644 +--- a/sos/plugins/openstack_instack.py ++++ b/sos/plugins/openstack_instack.py +@@ -34,14 +34,18 @@ class OpenStackInstack(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/mistral/", ++ self.add_copy_spec(["/var/log/mistral/", ++ "/var/log/containers/mistral/"], + sizelimit=self.limit) +- self.add_copy_spec("/var/log/zaqar/", ++ self.add_copy_spec(["/var/log/zaqar/", ++ "/var/log/containers/zaqar/"], + sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/mistral/*.log", ++ self.add_copy_spec(["/var/log/mistral/*.log", ++ "/var/log/containers/mistral/*.log"], + sizelimit=self.limit) +- self.add_copy_spec("/var/log/zaqar/*.log", ++ self.add_copy_spec(["/var/log/zaqar/*.log", ++ "/var/log/containers/zaqar/*.log"], + sizelimit=self.limit) + + vars = [p in os.environ for p in [ +diff --git a/sos/plugins/openstack_ironic.py b/sos/plugins/openstack_ironic.py +index f225427..e4e320d 100644 +--- a/sos/plugins/openstack_ironic.py ++++ b/sos/plugins/openstack_ironic.py +@@ -31,9 +31,13 @@ class OpenStackIronic(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/ironic/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/ironic/", ++ "/var/log/containers/ironic/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/ironic/*.log", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/ironic/*.log", ++ "/var/log/containers/ironic/*.log"], ++ sizelimit=self.limit) + + self.add_cmd_output('ls -laRt /var/lib/ironic/') + +diff --git a/sos/plugins/openstack_keystone.py b/sos/plugins/openstack_keystone.py +index cb8a626..5a8f4e2 100644 +--- a/sos/plugins/openstack_keystone.py ++++ b/sos/plugins/openstack_keystone.py +@@ -37,9 +37,13 @@ class OpenStackKeystone(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/keystone/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/keystone/", ++ "/var/log/containers/keystone/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/keystone/*.log", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/keystone/*.log", ++ "/var/log/containers/keystone/*.log"], ++ sizelimit=self.limit) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +diff --git a/sos/plugins/openstack_manila.py b/sos/plugins/openstack_manila.py +index ce50a31..c1e6609 100644 +--- a/sos/plugins/openstack_manila.py ++++ b/sos/plugins/openstack_manila.py +@@ -29,10 +29,12 @@ class OpenStackManila(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/manila/*", ++ self.add_copy_spec(["/var/log/manila/*", ++ "/var/log/containers/manila/*"], + sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/manila/*.log", ++ self.add_copy_spec(["/var/log/manila/*.log", ++ "/var/log/containers/manila/*.log"], + sizelimit=self.limit) + + def postproc(self): +diff --git a/sos/plugins/openstack_neutron.py b/sos/plugins/openstack_neutron.py +index 62fd1c3..b0f6699 100644 +--- a/sos/plugins/openstack_neutron.py ++++ b/sos/plugins/openstack_neutron.py +@@ -29,9 +29,13 @@ class OpenStackNeutron(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/neutron/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/neutron/", ++ "/var/log/containers/neutron/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/neutron/*.log", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/neutron/*.log", ++ "/var/log/containers/neutron/*.log"], ++ sizelimit=self.limit) + + self.add_copy_spec("/etc/neutron/") + self.add_copy_spec("/var/lib/neutron/") +diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py +index 14bdfbd..3dda7af 100644 +--- a/sos/plugins/openstack_nova.py ++++ b/sos/plugins/openstack_nova.py +@@ -63,9 +63,13 @@ class OpenStackNova(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/nova/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/nova/", ++ "/var/log/containers/nova/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/nova/*.log", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/nova/*.log", ++ "/var/log/containers/nova/*.log"], ++ sizelimit=self.limit) + + self.add_copy_spec("/etc/nova/") + +diff --git a/sos/plugins/openstack_sahara.py b/sos/plugins/openstack_sahara.py +index adbad32..adaedf9 100644 +--- a/sos/plugins/openstack_sahara.py ++++ b/sos/plugins/openstack_sahara.py +@@ -32,9 +32,13 @@ class OpenStackSahara(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/sahara/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/sahara/", ++ "/var/log/containers/sahara/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/sahara/*.log", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/sahara/*.log", ++ "/var/log/containers/sahara/*.log"], ++ sizelimit=self.limit) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +diff --git a/sos/plugins/openstack_swift.py b/sos/plugins/openstack_swift.py +index 790a4cb..9906b94 100644 +--- a/sos/plugins/openstack_swift.py ++++ b/sos/plugins/openstack_swift.py +@@ -31,9 +31,13 @@ class OpenStackSwift(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/swift/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/swift/", ++ "/var/log/containers/swift/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/swift/*.log", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/swift/*.log", ++ "/var/log/containers/swift/*.log"], ++ sizelimit=self.limit) + + self.add_copy_spec("/etc/swift/") + +diff --git a/sos/plugins/openstack_trove.py b/sos/plugins/openstack_trove.py +index 4d526b0..5183ad1 100644 +--- a/sos/plugins/openstack_trove.py ++++ b/sos/plugins/openstack_trove.py +@@ -30,9 +30,13 @@ class OpenStackTrove(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/trove/", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/trove/", ++ "/var/log/containers/trove/"], ++ sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/trove/*.log", sizelimit=self.limit) ++ self.add_copy_spec(["/var/log/trove/*.log", ++ "/var/log/containers/trove/*.log"], ++ sizelimit=self.limit) + + self.add_copy_spec('/etc/trove/') + +diff --git a/sos/plugins/pacemaker.py b/sos/plugins/pacemaker.py +index 9775284..5780c81 100644 +--- a/sos/plugins/pacemaker.py ++++ b/sos/plugins/pacemaker.py +@@ -36,7 +36,8 @@ class Pacemaker(Plugin, DebianPlugin, UbuntuPlugin): + "/var/lib/pacemaker/cib/cib.xml", + self.defaults, + "/var/log/pacemaker.log", +- "/var/log/pcsd/pcsd.log" ++ "/var/log/pcsd/pcsd.log", ++ "/var/log/pacemaker/bundles/*/", + ]) + self.add_cmd_output([ + "crm_mon -1 -A -n -r -t", +diff --git a/sos/plugins/rabbitmq.py b/sos/plugins/rabbitmq.py +index d9871a0..8d73835 100644 +--- a/sos/plugins/rabbitmq.py ++++ b/sos/plugins/rabbitmq.py +@@ -29,6 +29,7 @@ class RabbitMQ(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + self.add_cmd_output("rabbitmqctl list_policies") + + self.add_copy_spec("/etc/rabbitmq/*") +- self.add_copy_spec("/var/log/rabbitmq/*", ++ self.add_copy_spec(["/var/log/rabbitmq/*", ++ "/var/log/containers/rabbitmq/*"], + sizelimit=self.get_option('log_size')) + # vim: set et ts=4 sw=4 : +diff --git a/sos/plugins/redis.py b/sos/plugins/redis.py +index befa3d3..9ac2397 100644 +--- a/sos/plugins/redis.py ++++ b/sos/plugins/redis.py +@@ -32,10 +32,12 @@ class Redis(Plugin, RedHatPlugin): + self.limit = self.get_option("log_size") + self.add_cmd_output("redis-cli info") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/redis/redis.log*", ++ self.add_copy_spec(["/var/log/redis/redis.log*", ++ "/var/log/containers/redis/redis.log*"], + sizelimit=self.limit) + else: +- self.add_copy_spec("/var/log/redis/redis.log", ++ self.add_copy_spec(["/var/log/redis/redis.log", ++ "/var/log/containers/redis/redis.log"], + sizelimit=self.limit) + + def postproc(self): +-- +2.7.5 + +From 5bbe32f49f3406368ac794e638b61a3234da1d11 Mon Sep 17 00:00:00 2001 +From: stuggi +Date: Wed, 28 Jun 2017 21:35:45 +0200 +Subject: [PATCH] [openstack plugins] run openstack command when correct ENV is + set (#1048) + +With Tripleo Pike the default ENV changed from OS_TENANT_NAME to +OS_PROJECT_NAME. The commands of the openstack plugins against +the env should run when either OSP_TENANT_NAME or OS_PROJECT_NAME +is set. + +Signed-off-by: Martin Schuppert mschuppe@redhat.com +Signed-off-by: Adam Stokes +--- + sos/plugins/gnocchi.py | 10 +++++++--- + sos/plugins/openstack_glance.py | 10 +++++++--- + sos/plugins/openstack_heat.py | 10 +++++++--- + sos/plugins/openstack_instack.py | 10 +++++++--- + sos/plugins/openstack_ironic.py | 10 +++++++--- + sos/plugins/openstack_keystone.py | 10 +++++++--- + sos/plugins/openstack_neutron.py | 10 +++++++--- + sos/plugins/openstack_nova.py | 10 +++++++--- + 8 files changed, 56 insertions(+), 24 deletions(-) + +diff --git a/sos/plugins/gnocchi.py b/sos/plugins/gnocchi.py +index 14baf55..dc79a0f 100644 +--- a/sos/plugins/gnocchi.py ++++ b/sos/plugins/gnocchi.py +@@ -44,9 +44,13 @@ class GnocchiPlugin(Plugin, RedHatPlugin): + self.add_copy_spec("/var/log/gnocchi/*.log", + sizelimit=self.limit) + +- vars = [p in os.environ for p in [ +- 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +- if not all(vars): ++ vars_all = [p in os.environ for p in [ ++ 'OS_USERNAME', 'OS_PASSWORD']] ++ ++ vars_any = [p in os.environ for p in [ ++ 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ ++ if not (all(vars_all) and any(vars_any)): + self.soslog.warning("Not all environment variables set. Source " + "the environment file for the user intended " + "to connect to the OpenStack environment.") +diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py +index 88d06e3..6202c49 100644 +--- a/sos/plugins/openstack_glance.py ++++ b/sos/plugins/openstack_glance.py +@@ -51,9 +51,13 @@ class OpenStackGlance(Plugin): + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + +- vars = [p in os.environ for p in [ +- 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +- if not all(vars): ++ vars_all = [p in os.environ for p in [ ++ 'OS_USERNAME', 'OS_PASSWORD']] ++ ++ vars_any = [p in os.environ for p in [ ++ 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ ++ if not (all(vars_all) and any(vars_any)): + self.soslog.warning("Not all environment variables set. Source " + "the environment file for the user intended " + "to connect to the OpenStack environment.") +diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py +index 2dad83f..0f457d9 100644 +--- a/sos/plugins/openstack_heat.py ++++ b/sos/plugins/openstack_heat.py +@@ -34,9 +34,13 @@ class OpenStackHeat(Plugin): + suggest_filename="heat_db_version" + ) + +- vars = [p in os.environ for p in [ +- 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +- if not all(vars): ++ vars_all = [p in os.environ for p in [ ++ 'OS_USERNAME', 'OS_PASSWORD']] ++ ++ vars_any = [p in os.environ for p in [ ++ 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ ++ if not (all(vars_all) and any(vars_any)): + self.soslog.warning("Not all environment variables set. Source " + "the environment file for the user intended " + "to connect to the OpenStack environment.") +diff --git a/sos/plugins/openstack_instack.py b/sos/plugins/openstack_instack.py +index 87ec59f..f990476 100644 +--- a/sos/plugins/openstack_instack.py ++++ b/sos/plugins/openstack_instack.py +@@ -48,9 +48,13 @@ class OpenStackInstack(Plugin): + "/var/log/containers/zaqar/*.log"], + sizelimit=self.limit) + +- vars = [p in os.environ for p in [ +- 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +- if not all(vars): ++ vars_all = [p in os.environ for p in [ ++ 'OS_USERNAME', 'OS_PASSWORD']] ++ ++ vars_any = [p in os.environ for p in [ ++ 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ ++ if not (all(vars_all) and any(vars_any)): + self.soslog.warning("Not all environment variables set. Source " + "the environment file for the user intended " + "to connect to the OpenStack environment.") +diff --git a/sos/plugins/openstack_ironic.py b/sos/plugins/openstack_ironic.py +index e4e320d..0396cc6 100644 +--- a/sos/plugins/openstack_ironic.py ++++ b/sos/plugins/openstack_ironic.py +@@ -44,9 +44,13 @@ class OpenStackIronic(Plugin): + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + +- vars = [p in os.environ for p in [ +- 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +- if not all(vars): ++ vars_all = [p in os.environ for p in [ ++ 'OS_USERNAME', 'OS_PASSWORD']] ++ ++ vars_any = [p in os.environ for p in [ ++ 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ ++ if not (all(vars_all) and any(vars_any)): + self.soslog.warning("Not all environment variables set. Source " + "the environment file for the user intended " + "to connect to the OpenStack environment.") +diff --git a/sos/plugins/openstack_keystone.py b/sos/plugins/openstack_keystone.py +index 5a8f4e2..82e987a 100644 +--- a/sos/plugins/openstack_keystone.py ++++ b/sos/plugins/openstack_keystone.py +@@ -48,9 +48,13 @@ class OpenStackKeystone(Plugin): + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + +- vars = [p in os.environ for p in [ +- 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +- if not all(vars): ++ vars_all = [p in os.environ for p in [ ++ 'OS_USERNAME', 'OS_PASSWORD']] ++ ++ vars_any = [p in os.environ for p in [ ++ 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ ++ if not (all(vars_all) and any(vars_any)): + self.soslog.warning("Not all environment variables set. Source " + "the environment file for the user intended " + "to connect to the OpenStack environment.") +diff --git a/sos/plugins/openstack_neutron.py b/sos/plugins/openstack_neutron.py +index b0f6699..d2bfe6b 100644 +--- a/sos/plugins/openstack_neutron.py ++++ b/sos/plugins/openstack_neutron.py +@@ -42,9 +42,13 @@ class OpenStackNeutron(Plugin): + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + +- vars = [p in os.environ for p in [ +- 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +- if not all(vars): ++ vars_all = [p in os.environ for p in [ ++ 'OS_USERNAME', 'OS_PASSWORD']] ++ ++ vars_any = [p in os.environ for p in [ ++ 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ ++ if not (all(vars_all) and any(vars_any)): + self.soslog.warning("Not all environment variables set. Source " + "the environment file for the user intended " + "to connect to the OpenStack environment.") +diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py +index 3dda7af..c0e8109 100644 +--- a/sos/plugins/openstack_nova.py ++++ b/sos/plugins/openstack_nova.py +@@ -35,9 +35,13 @@ class OpenStackNova(Plugin): + self.add_cmd_output("nova-manage fixed list") + self.add_cmd_output("nova-manage floating list") + +- vars = [p in os.environ for p in [ +- 'OS_USERNAME', 'OS_PASSWORD', 'OS_TENANT_NAME']] +- if not all(vars): ++ vars_all = [p in os.environ for p in [ ++ 'OS_USERNAME', 'OS_PASSWORD']] ++ ++ vars_any = [p in os.environ for p in [ ++ 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ ++ if not (all(vars_all) and any(vars_any)): + self.soslog.warning("Not all environment variables set. Source " + "the environment file for the user intended " + "to connect to the OpenStack environment.") +-- +2.7.5 + +From f379776da6d2d3f4e3f31bf34b12908674dc122d Mon Sep 17 00:00:00 2001 +From: Martin Schuppert +Date: Wed, 28 Jun 2017 16:21:05 +0200 +Subject: [PATCH] [gnocchi] Tripleo specific containerized services logs + +This is an addition to pull request 1046 to collect gnocchi logs +correct when service is running in a container. + +Signed-off-by: Martin Schuppert mschuppert@redhat.com +--- + sos/plugins/gnocchi.py | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/sos/plugins/gnocchi.py b/sos/plugins/gnocchi.py +index dc79a0f..724e41b 100644 +--- a/sos/plugins/gnocchi.py ++++ b/sos/plugins/gnocchi.py +@@ -38,11 +38,17 @@ class GnocchiPlugin(Plugin, RedHatPlugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec("/var/log/gnocchi/", +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/gnocchi/*", ++ "/var/log/containers/gnocchi/*"], ++ sizelimit=self.limit ++ ) + else: +- self.add_copy_spec("/var/log/gnocchi/*.log", +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/gnocchi/*.log", ++ "/var/log/containers/gnocchi/*.log"], ++ sizelimit=self.limit ++ ) + + vars_all = [p in os.environ for p in [ + 'OS_USERNAME', 'OS_PASSWORD']] +-- +2.7.5 + +From 55800f71bdcfdea22b1d6e1c68848e58eb087d1c Mon Sep 17 00:00:00 2001 +From: Martin Schuppert +Date: Sun, 9 Jul 2017 15:22:30 +0200 +Subject: [PATCH] [openstack plugins] Tripleo specific containerized services + configs + +Add Tripleo Pike opinionated config paths to be collected +for services, when running in containers. Each service has a +config dir in /var/lib/config-data/puppet-generated on the host +which gets bind mounted read only into the container. + +Closes #1054 + +Signed-off-by: Martin Schuppert +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/gnocchi.py | 18 +++++++++++++- + sos/plugins/haproxy.py | 6 ++++- + sos/plugins/iscsi.py | 2 ++ + sos/plugins/mongodb.py | 15 +++++++++++- + sos/plugins/mysql.py | 5 ++-- + sos/plugins/openstack_ceilometer.py | 24 ++++++++++++------ + sos/plugins/openstack_glance.py | 25 +++++++++++++------ + sos/plugins/openstack_heat.py | 49 ++++++++++++++++++++++++++++++------- + sos/plugins/openstack_horizon.py | 48 ++++++++++++++++++++++++++---------- + sos/plugins/openstack_keystone.py | 28 +++++++++++++++------ + sos/plugins/openstack_manila.py | 25 +++++++++++++------ + sos/plugins/openstack_neutron.py | 27 ++++++++++++++------ + sos/plugins/openstack_nova.py | 37 ++++++++++++++++++++++------ + sos/plugins/openstack_sahara.py | 24 ++++++++++++------ + sos/plugins/openstack_swift.py | 30 +++++++++++++++++------ + sos/plugins/openstack_trove.py | 25 +++++++++++++------ + sos/plugins/rabbitmq.py | 22 +++++++++++++---- + sos/plugins/redis.py | 40 ++++++++++++++++++++++++------ + 18 files changed, 345 insertions(+), 105 deletions(-) + +diff --git a/sos/plugins/gnocchi.py b/sos/plugins/gnocchi.py +index 724e41b..c7a9709 100644 +--- a/sos/plugins/gnocchi.py ++++ b/sos/plugins/gnocchi.py +@@ -33,8 +33,17 @@ class GnocchiPlugin(Plugin, RedHatPlugin): + + requires_root = False + ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/gnocchi" ++ + def setup(self): +- self.add_copy_spec("/etc/gnocchi/") ++ self.add_copy_spec([ ++ "/etc/gnocchi/*", ++ self.var_puppet_gen + "/etc/gnocchi/*", ++ self.var_puppet_gen + "/etc/httpd/conf/*", ++ self.var_puppet_gen + "/etc/httpd/conf.d/*", ++ self.var_puppet_gen + "/etc/httpd/conf.modules.d/wsgi.conf", ++ self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf" ++ ]) + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +@@ -76,5 +85,12 @@ class GnocchiPlugin(Plugin, RedHatPlugin): + r"password=(.*)", + r"password=*****", + ) ++ self.do_file_sub( ++ self.var_puppet_gen + "/etc/gnocchi/" ++ "gnocchi.conf", ++ r"password=(.*)", ++ r"password=*****", ++ ) ++ + + # vim: set et ts=4 sw=4 : +diff --git a/sos/plugins/haproxy.py b/sos/plugins/haproxy.py +index 6ec98d2..9084506 100644 +--- a/sos/plugins/haproxy.py ++++ b/sos/plugins/haproxy.py +@@ -27,7 +27,11 @@ class HAProxy(Plugin, RedHatPlugin, DebianPlugin): + packages = ('haproxy',) + + def setup(self): +- self.add_copy_spec("/etc/haproxy/haproxy.cfg") ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/haproxy" ++ self.add_copy_spec([ ++ "/etc/haproxy/haproxy.cfg", ++ var_puppet_gen + "/etc/haproxy/haproxy.cfg" ++ ]) + self.add_copy_spec("/etc/haproxy/conf.d/*") + self.add_cmd_output("haproxy -f /etc/haproxy/haproxy.cfg -c") + +diff --git a/sos/plugins/iscsi.py b/sos/plugins/iscsi.py +index 7324b26..66aa632 100644 +--- a/sos/plugins/iscsi.py ++++ b/sos/plugins/iscsi.py +@@ -30,9 +30,11 @@ class RedHatIscsi(Iscsi, RedHatPlugin): + + def setup(self): + super(RedHatIscsi, self).setup() ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/iscsid" + self.add_copy_spec([ + "/etc/iscsi/iscsid.conf", + "/etc/iscsi/initiatorname.iscsi", ++ var_puppet_gen + "/etc/iscsi/initiatorname.iscsi", + "/var/lib/iscsi" + ]) + self.add_cmd_output([ +diff --git a/sos/plugins/mongodb.py b/sos/plugins/mongodb.py +index 46b0251..8c89517 100644 +--- a/sos/plugins/mongodb.py ++++ b/sos/plugins/mongodb.py +@@ -25,11 +25,18 @@ class MongoDb(Plugin, DebianPlugin, UbuntuPlugin): + profiles = ('services',) + + packages = ('mongodb-server',) +- files = ('/etc/mongodb.conf',) ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/mongodb" ++ ++ files = ( ++ '/etc/mongodb.conf', ++ var_puppet_gen + '/etc/mongod.conf' ++ ) + + def setup(self): + self.add_copy_spec([ + "/etc/mongodb.conf", ++ self.var_puppet_gen + "/etc/", ++ self.var_puppet_gen + "/etc/systemd/system/mongod.service.d/", + "/var/log/mongodb/mongodb.log", + "/var/log/containers/mongodb/mongodb.log" + ]) +@@ -41,6 +48,12 @@ class MongoDb(Plugin, DebianPlugin, UbuntuPlugin): + r"mms-token = ********" + ) + ++ self.do_file_sub( ++ self.var_puppet_gen + "/etc/mongodb.conf", ++ r"(mms-token\s*=\s*.*)", ++ r"mms-token = ********" ++ ) ++ + + class RedHatMongoDb(MongoDb, RedHatPlugin): + +diff --git a/sos/plugins/mysql.py b/sos/plugins/mysql.py +index 7bf933a..decca69 100644 +--- a/sos/plugins/mysql.py ++++ b/sos/plugins/mysql.py +@@ -93,9 +93,10 @@ class RedHatMysql(Mysql, RedHatPlugin): + super(RedHatMysql, self).setup() + self.add_copy_spec([ + "/etc/ld.so.conf.d/mysql-*.conf", +- "/etc/ld.so.conf.d/mariadb-*.conf" ++ "/etc/ld.so.conf.d/mariadb-*.conf", ++ "/etc/my.cnf.d/*", ++ "/var/lib/config-data/puppet-generated/mysql/etc/my.cnf.d/*" + ]) +- self.add_copy_spec("/etc/my.cnf.d/*") + + + class DebianMysql(Mysql, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/openstack_ceilometer.py b/sos/plugins/openstack_ceilometer.py +index 2c3a809..b3c6bd8 100644 +--- a/sos/plugins/openstack_ceilometer.py ++++ b/sos/plugins/openstack_ceilometer.py +@@ -27,19 +27,25 @@ class OpenStackCeilometer(Plugin): + profiles = ('openstack', 'openstack_controller', 'openstack_compute') + + option_list = [] ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/ceilometer" + + def setup(self): + # Ceilometer + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/ceilometer/", +- "/var/log/containers/ceilometer/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/ceilometer/*", ++ "/var/log/containers/ceilometer/*" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/ceilometer/*.log", +- "/var/log/containers/ceilometer/*.log"], +- sizelimit=self.limit) +- self.add_copy_spec("/etc/ceilometer/") ++ self.add_copy_spec([ ++ "/var/log/ceilometer/*.log", ++ "/var/log/containers/ceilometer/*.log" ++ ], sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/etc/ceilometer/*", ++ self.var_puppet_gen + "/etc/ceilometer/*" ++ ]) + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + +@@ -54,6 +60,10 @@ class OpenStackCeilometer(Plugin): + + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) + self.do_path_regex_sub("/etc/ceilometer/*", regexp, r"\1*********") ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "/etc/ceilometer/*", ++ regexp, r"\1*********" ++ ) + + + class DebianCeilometer(OpenStackCeilometer, DebianPlugin, +diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py +index 6202c49..0a2bdc1 100644 +--- a/sos/plugins/openstack_glance.py ++++ b/sos/plugins/openstack_glance.py +@@ -28,6 +28,7 @@ class OpenStackGlance(Plugin): + profiles = ('openstack', 'openstack_controller') + + option_list = [] ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/glance_api" + + def setup(self): + # Glance +@@ -38,15 +39,21 @@ class OpenStackGlance(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/glance/", +- "/var/log/containers/glance/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/glance/", ++ "/var/log/containers/glance/" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/glance/*.log", +- "/var/log/containers/glance/*.log"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/glance/*.log", ++ "/var/log/containers/glance/*.log" ++ ], sizelimit=self.limit) + +- self.add_copy_spec("/etc/glance/") ++ self.add_copy_spec([ ++ "/etc/glance/", ++ self.var_puppet_gen + "/etc/glance/", ++ self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf" ++ ]) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +@@ -73,6 +80,10 @@ class OpenStackGlance(Plugin): + + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) + self.do_path_regex_sub("/etc/glance/*", regexp, r"\1*********") ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "/etc/glance/*", ++ regexp, r"\1*********" ++ ) + + + class DebianGlance(OpenStackGlance, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py +index 0f457d9..a73916b 100644 +--- a/sos/plugins/openstack_heat.py ++++ b/sos/plugins/openstack_heat.py +@@ -26,6 +26,7 @@ class OpenStackHeat(Plugin): + profiles = ('openstack', 'openstack_controller') + + option_list = [] ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/heat" + + def setup(self): + # Heat +@@ -49,15 +50,31 @@ class OpenStackHeat(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/heat/", +- "/var/log/containers/heat/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/heat/", ++ "/var/log/containers/heat/" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/heat/*.log", +- "/var/log/containers/heat/*.log"], +- sizelimit=self.limit) +- +- self.add_copy_spec("/etc/heat/") ++ self.add_copy_spec([ ++ "/var/log/heat/*.log", ++ "/var/log/containers/heat/*.log" ++ ], sizelimit=self.limit) ++ ++ self.add_copy_spec([ ++ "/etc/heat/", ++ self.var_puppet_gen + "/etc/heat/", ++ self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf", ++ self.var_puppet_gen + "_api/etc/heat/", ++ self.var_puppet_gen + "_api/etc/httpd/conf/", ++ self.var_puppet_gen + "_api/etc/httpd/conf.d/", ++ self.var_puppet_gen + "_api/etc/httpd/conf.modules.d/*.conf", ++ self.var_puppet_gen + "_api/var/spool/cron/heat", ++ self.var_puppet_gen + "_api_cfn/etc/heat/", ++ self.var_puppet_gen + "_api_cfn/etc/httpd/conf/", ++ self.var_puppet_gen + "_api_cfn/etc/httpd/conf.d/", ++ self.var_puppet_gen + "_api_cfn/etc/httpd/conf.modules.d/*.conf", ++ self.var_puppet_gen + "_api_cfn/var/spool/cron/heat", ++ ]) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +@@ -69,7 +86,21 @@ class OpenStackHeat(Plugin): + ] + + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) +- self.do_path_regex_sub("/etc/heat/*", regexp, r"\1*********") ++ self.do_path_regex_sub( ++ "/etc/heat/*", ++ regexp, r"\1*********") ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "/etc/heat/*", ++ regexp, r"\1*********" ++ ) ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "_api/etc/heat/*", ++ regexp, r"\1*********" ++ ) ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "_api_cfn/etc/heat/*", ++ regexp, r"\1*********" ++ ) + + + class DebianHeat(OpenStackHeat, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/openstack_horizon.py b/sos/plugins/openstack_horizon.py +index 75ad3ce..a9a7fab 100644 +--- a/sos/plugins/openstack_horizon.py ++++ b/sos/plugins/openstack_horizon.py +@@ -27,36 +27,58 @@ class OpenStackHorizon(Plugin): + plugin_name = "openstack_horizon" + profiles = ('openstack', 'openstack_controller') + option_list = [] ++ var_puppet_gen = "/var/lib/config-data/puppet-generated" + + def setup(self): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/horizon/", +- "/var/log/containers/horizon/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/horizon/", ++ "/var/log/containers/horizon/" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/horizon/*.log", +- "/var/log/containers/horizon/*.log"], +- sizelimit=self.limit) +- +- self.add_copy_spec("/etc/openstack-dashboard/") ++ self.add_copy_spec([ ++ "/var/log/horizon/*.log", ++ "/var/log/containers/horizon/*.log" ++ ], sizelimit=self.limit) ++ ++ self.add_copy_spec([ ++ "/etc/openstack-dashboard/", ++ self.var_puppet_gen + "/horizon/etc/openstack-dashboard/", ++ self.var_puppet_gen + "/horizon/etc/httpd/conf/", ++ self.var_puppet_gen + "/horizon/etc/httpd/conf.d/", ++ self.var_puppet_gen + "/horizon/etc/httpd/conf.modules.d/*.conf", ++ self.var_puppet_gen + "/memcached/etc/sysconfig/memcached" ++ ]) + self.add_forbidden_path("*.py[co]") + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + + def postproc(self): ++ var_puppet_gen = self.var_puppet_gen + "/horizon" + protect_keys = [ + "SECRET_KEY", "EMAIL_HOST_PASSWORD" + ] + + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) +- self.do_path_regex_sub("/etc/openstack-dashboard/.*\.json", +- regexp, r"\1*********") +- self.do_path_regex_sub("/etc/openstack-dashboard/local_settings/ + \ +- .*\.conf.*", +- regexp, r"\1*********") ++ self.do_path_regex_sub( ++ "/etc/openstack-dashboard/.*\.json", ++ regexp, r"\1*********" ++ ) ++ self.do_path_regex_sub( ++ var_puppet_gen + "/etc/openstack-dashboard/.*\.json", ++ regexp, r"\1*********" ++ ) ++ self.do_path_regex_sub( ++ "/etc/openstack-dashboard/local_settings/.*\.conf.*", ++ regexp, r"\1*********" ++ ) ++ self.do_path_regex_sub( ++ var_puppet_gen + "/etc/openstack-dashboard/.*\.conf.*", ++ regexp, r"\1*********" ++ ) + + + class DebianHorizon(OpenStackHorizon, DebianPlugin): +diff --git a/sos/plugins/openstack_keystone.py b/sos/plugins/openstack_keystone.py +index 82e987a..bdcb61d 100644 +--- a/sos/plugins/openstack_keystone.py ++++ b/sos/plugins/openstack_keystone.py +@@ -26,24 +26,34 @@ class OpenStackKeystone(Plugin): + profiles = ('openstack', 'openstack_controller') + + option_list = [("nopw", "dont gathers keystone passwords", "slow", True)] ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/keystone" + + def setup(self): + self.add_copy_spec([ + "/etc/keystone/default_catalog.templates", + "/etc/keystone/keystone.conf", + "/etc/keystone/logging.conf", +- "/etc/keystone/policy.json" ++ "/etc/keystone/policy.json", ++ self.var_puppet_gen + "/etc/keystone/*.conf", ++ self.var_puppet_gen + "/etc/keystone/*.json", ++ self.var_puppet_gen + "/etc/httpd/conf/", ++ self.var_puppet_gen + "/etc/httpd/conf.d/", ++ self.var_puppet_gen + "/etc/httpd/conf.modules.d/*.conf", ++ self.var_puppet_gen + "/var/spool/cron/", ++ self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf" + ]) + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/keystone/", +- "/var/log/containers/keystone/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/keystone/", ++ "/var/log/containers/keystone/" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/keystone/*.log", +- "/var/log/containers/keystone/*.log"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/keystone/*.log", ++ "/var/log/containers/keystone/*.log" ++ ], sizelimit=self.limit) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +@@ -71,6 +81,10 @@ class OpenStackKeystone(Plugin): + + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) + self.do_path_regex_sub("/etc/keystone/*", regexp, r"\1*********") ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "/etc/keystone/*", ++ regexp, r"\1*********" ++ ) + + + class DebianKeystone(OpenStackKeystone, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/openstack_manila.py b/sos/plugins/openstack_manila.py +index c1e6609..92bca6f 100644 +--- a/sos/plugins/openstack_manila.py ++++ b/sos/plugins/openstack_manila.py +@@ -24,18 +24,25 @@ class OpenStackManila(Plugin): + profiles = ('openstack', 'openstack_controller') + option_list = [] + ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/manila" ++ + def setup(self): +- self.add_copy_spec("/etc/manila/") ++ self.add_copy_spec([ ++ "/etc/manila/", ++ self.var_puppet_gen + "/etc/manila/" ++ ]) + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/manila/*", +- "/var/log/containers/manila/*"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/manila/*", ++ "/var/log/containers/manila/*" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/manila/*.log", +- "/var/log/containers/manila/*.log"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/manila/*.log", ++ "/var/log/containers/manila/*.log" ++ ], sizelimit=self.limit) + + def postproc(self): + protect_keys = [ +@@ -47,6 +54,10 @@ class OpenStackManila(Plugin): + + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) + self.do_path_regex_sub("/etc/manila/*", regexp, r"\1*********") ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "/etc/manila/*", ++ regexp, r"\1*********" ++ ) + + + class DebianManila(OpenStackManila, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/openstack_neutron.py b/sos/plugins/openstack_neutron.py +index d2bfe6b..b6116c7 100644 +--- a/sos/plugins/openstack_neutron.py ++++ b/sos/plugins/openstack_neutron.py +@@ -25,19 +25,26 @@ class OpenStackNeutron(Plugin): + plugin_name = "openstack_neutron" + profiles = ('openstack', 'openstack_controller', 'openstack_compute') + ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/neutron" ++ + def setup(self): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/neutron/", +- "/var/log/containers/neutron/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/neutron/", ++ "/var/log/containers/neutron/" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/neutron/*.log", +- "/var/log/containers/neutron/*.log"], +- sizelimit=self.limit) +- +- self.add_copy_spec("/etc/neutron/") ++ self.add_copy_spec([ ++ "/var/log/neutron/*.log", ++ "/var/log/containers/neutron/*.log" ++ ], sizelimit=self.limit) ++ ++ self.add_copy_spec([ ++ "/etc/neutron/", ++ self.var_puppet_gen + "/etc/neutron/" ++ ]) + self.add_copy_spec("/var/lib/neutron/") + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +@@ -75,6 +82,10 @@ class OpenStackNeutron(Plugin): + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) + + self.do_path_regex_sub("/etc/neutron/*", regexp, r"\1*********") ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "/etc/neutron/*", ++ regexp, r"\1*********" ++ ) + + + class DebianNeutron(OpenStackNeutron, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py +index c0e8109..75dd372 100644 +--- a/sos/plugins/openstack_nova.py ++++ b/sos/plugins/openstack_nova.py +@@ -29,6 +29,8 @@ class OpenStackNova(Plugin): + plugin_name = "openstack_nova" + profiles = ('openstack', 'openstack_controller', 'openstack_compute') + ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/nova" ++ + def setup(self): + # commands we do not need to source the environment file + self.add_cmd_output("nova-manage db version") +@@ -67,15 +69,28 @@ class OpenStackNova(Plugin): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/nova/", +- "/var/log/containers/nova/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/nova/", ++ "/var/log/containers/nova/" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/nova/*.log", +- "/var/log/containers/nova/*.log"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/nova/*.log", ++ "/var/log/containers/nova/*.log" ++ ], sizelimit=self.limit) + +- self.add_copy_spec("/etc/nova/") ++ self.add_copy_spec([ ++ "/etc/nova/", ++ self.var_puppet_gen + "/etc/nova/", ++ self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf", ++ self.var_puppet_gen + "_placement/var/spool/cron/nova", ++ self.var_puppet_gen + "_placement/etc/nova/", ++ self.var_puppet_gen + "_placement/etc/httpd/conf/", ++ self.var_puppet_gen + "_placement/etc/httpd/conf.d/", ++ self.var_puppet_gen + "_placement/etc/httpd/conf.modules.d/*.conf", ++ self.var_puppet_gen + "_placement/etc/my.cnf.d/tripleo.cnf", ++ self.var_puppet_gen + "/../memcached/etc/sysconfig/memcached" ++ ]) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +@@ -92,6 +107,14 @@ class OpenStackNova(Plugin): + + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) + self.do_path_regex_sub("/etc/nova/*", regexp, r"\1*********") ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "/etc/nova/*", ++ regexp, r"\1*********" ++ ) ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "_placement/etc/nova/*", ++ regexp, r"\1*********" ++ ) + + + class DebianNova(OpenStackNova, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/openstack_sahara.py b/sos/plugins/openstack_sahara.py +index adaedf9..68cf0b3 100644 +--- a/sos/plugins/openstack_sahara.py ++++ b/sos/plugins/openstack_sahara.py +@@ -23,22 +23,28 @@ class OpenStackSahara(Plugin): + profiles = ('openstack', 'openstack_controller') + + option_list = [] ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/sahara" + + def setup(self): +- self.add_copy_spec("/etc/sahara/") ++ self.add_copy_spec([ ++ "/etc/sahara/", ++ self.var_puppet_gen + "/etc/sahara/" ++ ]) + self.add_journal(units="openstack-sahara-all") + self.add_journal(units="openstack-sahara-api") + self.add_journal(units="openstack-sahara-engine") + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/sahara/", +- "/var/log/containers/sahara/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/sahara/", ++ "/var/log/containers/sahara/" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/sahara/*.log", +- "/var/log/containers/sahara/*.log"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/sahara/*.log", ++ "/var/log/containers/sahara/*.log" ++ ], sizelimit=self.limit) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +@@ -52,6 +58,10 @@ class OpenStackSahara(Plugin): + + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) + self.do_path_regex_sub("/etc/sahara/*", regexp, r"\1*********") ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "/etc/sahara/*", ++ regexp, r"\1*********" ++ ) + + + class DebianSahara(OpenStackSahara, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/openstack_swift.py b/sos/plugins/openstack_swift.py +index 9906b94..1cfff2b 100644 +--- a/sos/plugins/openstack_swift.py ++++ b/sos/plugins/openstack_swift.py +@@ -27,19 +27,29 @@ class OpenStackSwift(Plugin): + + option_list = [] + ++ var_puppet_gen = "/var/lib/config-data/puppet-generated" ++ + def setup(self): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/swift/", +- "/var/log/containers/swift/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/swift/", ++ "/var/log/containers/swift/" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/swift/*.log", +- "/var/log/containers/swift/*.log"], +- sizelimit=self.limit) +- +- self.add_copy_spec("/etc/swift/") ++ self.add_copy_spec([ ++ "/var/log/swift/*.log", ++ "/var/log/containers/swift/*.log" ++ ], sizelimit=self.limit) ++ ++ self.add_copy_spec([ ++ "/etc/swift/", ++ self.var_puppet_gen + "/swift/etc/*", ++ self.var_puppet_gen + "/swift/etc/swift/*", ++ self.var_puppet_gen + "/swift/etc/xinetd.d/*", ++ self.var_puppet_gen + "/memcached/etc/sysconfig/memcached" ++ ]) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +@@ -54,6 +64,10 @@ class OpenStackSwift(Plugin): + + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) + self.do_path_regex_sub("/etc/swift/.*\.conf.*", regexp, r"\1*********") ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "/swift/etc/swift/.*\.conf.*", ++ regexp, r"\1*********" ++ ) + + + class DebianSwift(OpenStackSwift, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/openstack_trove.py b/sos/plugins/openstack_trove.py +index 5183ad1..093e5d5 100644 +--- a/sos/plugins/openstack_trove.py ++++ b/sos/plugins/openstack_trove.py +@@ -26,19 +26,26 @@ class OpenStackTrove(Plugin): + profiles = ('openstack', 'openstack_controller') + option_list = [] + ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/trove" ++ + def setup(self): + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/trove/", +- "/var/log/containers/trove/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/trove/", ++ "/var/log/containers/trove/" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/trove/*.log", +- "/var/log/containers/trove/*.log"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/trove/*.log", ++ "/var/log/containers/trove/*.log" ++ ], sizelimit=self.limit) + +- self.add_copy_spec('/etc/trove/') ++ self.add_copy_spec([ ++ '/etc/trove/', ++ self.var_puppet_gen + '/etc/trove/' ++ ]) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +@@ -53,6 +60,10 @@ class OpenStackTrove(Plugin): + + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) + self.do_path_regex_sub("/etc/trove/*", regexp, r"\1*********") ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "/etc/trove/*", ++ regexp, r"\1*********" ++ ) + + + class DebianTrove(OpenStackTrove, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/rabbitmq.py b/sos/plugins/rabbitmq.py +index 8d73835..2c7e428 100644 +--- a/sos/plugins/rabbitmq.py ++++ b/sos/plugins/rabbitmq.py +@@ -20,7 +20,11 @@ class RabbitMQ(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + """ + plugin_name = 'rabbitmq' + profiles = ('services',) +- files = ('/etc/rabbitmq/rabbitmq.conf',) ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/rabbitmq" ++ files = ( ++ '/etc/rabbitmq/rabbitmq.conf', ++ var_puppet_gen + '/etc/rabbitmq/rabbitmq.config' ++ ) + packages = ('rabbitmq-server',) + + def setup(self): +@@ -28,8 +32,16 @@ class RabbitMQ(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + self.add_cmd_output("rabbitmqctl cluster_status") + self.add_cmd_output("rabbitmqctl list_policies") + +- self.add_copy_spec("/etc/rabbitmq/*") +- self.add_copy_spec(["/var/log/rabbitmq/*", +- "/var/log/containers/rabbitmq/*"], +- sizelimit=self.get_option('log_size')) ++ self.add_copy_spec([ ++ "/etc/rabbitmq/*", ++ self.var_puppet_gen + "/etc/rabbitmq/*", ++ self.var_puppet_gen + "/etc/security/limits.d/", ++ self.var_puppet_gen + "/etc/systemd/" ++ ]) ++ self.add_copy_spec([ ++ "/var/log/rabbitmq/*", ++ "/var/log/containers/rabbitmq/*" ++ ], sizelimit=self.get_option('log_size')) ++ ++ + # vim: set et ts=4 sw=4 : +diff --git a/sos/plugins/redis.py b/sos/plugins/redis.py +index 9ac2397..088a9a2 100644 +--- a/sos/plugins/redis.py ++++ b/sos/plugins/redis.py +@@ -1,4 +1,5 @@ + # Copyright (C) 2015 Red Hat, Inc., Abhijeet Kasurde ++# Copyright (C) 2017 Red Hat, Inc., Martin Schuppert + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -25,20 +26,32 @@ class Redis(Plugin, RedHatPlugin): + profiles = ('services',) + + packages = ('redis',) +- files = ('/etc/redis.conf', '/var/log/redis') ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/redis" ++ files = ( ++ '/etc/redis.conf', ++ '/var/log/redis', ++ var_puppet_gen + '/etc/redis.conf' ++ ) + + def setup(self): +- self.add_copy_spec("/etc/redis.conf") ++ self.add_copy_spec([ ++ "/etc/redis.conf", ++ self.var_puppet_gen + "/etc/redis*", ++ self.var_puppet_gen + "/etc/redis/", ++ self.var_puppet_gen + "/etc/security/limits.d/" ++ ]) + self.limit = self.get_option("log_size") + self.add_cmd_output("redis-cli info") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/redis/redis.log*", +- "/var/log/containers/redis/redis.log*"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/redis/redis.log*", ++ "/var/log/containers/redis/redis.log*" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/redis/redis.log", +- "/var/log/containers/redis/redis.log"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/redis/redis.log", ++ "/var/log/containers/redis/redis.log" ++ ], sizelimit=self.limit) + + def postproc(self): + self.do_file_sub( +@@ -51,5 +64,16 @@ class Redis(Plugin, RedHatPlugin): + 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*********" ++ ) ++ + + # vim: set et ts=4 sw=4 : +-- +2.7.5 + diff --git a/SOURCES/sos-bz1470573-tripleo-add-ui-logs.patch b/SOURCES/sos-bz1470573-tripleo-add-ui-logs.patch new file mode 100644 index 0000000..78de519 --- /dev/null +++ b/SOURCES/sos-bz1470573-tripleo-add-ui-logs.patch @@ -0,0 +1,30 @@ +From de9864a01cdd6ef9f27305990a34e9ca5b7baa5b Mon Sep 17 00:00:00 2001 +From: Honza Pokorny +Date: Thu, 6 Jul 2017 14:40:03 -0300 +Subject: [PATCH] [tripleo] Add ui logs (#1052) + +We're using the "openstack" command to stream the ui log file to stdout. + +Signed-off-by: Honza Pokorny +Signed-off-by: Adam Stokes +--- + sos/plugins/openstack_instack.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sos/plugins/openstack_instack.py b/sos/plugins/openstack_instack.py +index f990476..a2c1617 100644 +--- a/sos/plugins/openstack_instack.py ++++ b/sos/plugins/openstack_instack.py +@@ -83,6 +83,9 @@ class OpenStackInstack(Plugin): + deployment + ".log", + timeout=600) + ++ self.add_cmd_output("openstack object save " ++ "tripleo-ui-logs tripleo-ui.logs --file -") ++ + def postproc(self): + protected_keys = [ + "UNDERCLOUD_TUSKAR_PASSWORD", "UNDERCLOUD_ADMIN_PASSWORD", +-- +2.7.5 + diff --git a/SOURCES/sos-bz1482574-jars-redundant-os-walk.patch b/SOURCES/sos-bz1482574-jars-redundant-os-walk.patch new file mode 100644 index 0000000..8b036f7 --- /dev/null +++ b/SOURCES/sos-bz1482574-jars-redundant-os-walk.patch @@ -0,0 +1,106 @@ +From 6fc42802b87f95dba1d6bfda49ae158143e7799c Mon Sep 17 00:00:00 2001 +From: Michal Srb +Date: Mon, 21 Aug 2017 16:29:23 +0200 +Subject: [PATCH 1/2] [jars] Scan only /usr/{share,lib}/java by default + +Other known locations can be added via: +-k jars.all_known_locations + +Additional user-specified locations can be added via: +-k jars.append_locations=... + +Signed-off-by: Michal Srb +--- + sos/plugins/jars.py | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/sos/plugins/jars.py b/sos/plugins/jars.py +index c6cba96..486ac05 100644 +--- a/sos/plugins/jars.py ++++ b/sos/plugins/jars.py +@@ -31,7 +31,8 @@ class Jars(Plugin, RedHatPlugin): + profiles = ("java",) + option_list = [ + ("append_locations", "colon-separated list of additional JAR paths", +- "fast", "") ++ "fast", ""), ++ ("all_known_locations", "scan all known paths", "slow", False) + ] + + # There is no standard location for JAR files and scanning +@@ -39,7 +40,12 @@ class Jars(Plugin, RedHatPlugin): + # scan directories in which JARs can be typically found. + jar_locations = ( + "/usr/share/java", # common location for JARs +- "/usr/lib/java", # common location for JARs containing native code ++ "/usr/lib/java" # common location for JARs containing native code ++ ) ++ ++ # Following paths can be optionally scanned as well. Note the scan can take ++ # *very* long time. ++ extra_jar_locations = ( + "/opt", # location for RHSCL and 3rd party software + "/usr/local", # used by sysadmins when installing SW locally + "/var/lib" # Java services commonly explode WARs there +@@ -50,9 +56,13 @@ class Jars(Plugin, RedHatPlugin): + jar_paths = [] + + locations = list(Jars.jar_locations) +- extra_locations = self.get_option("append_locations") +- if extra_locations: +- locations += extra_locations.split(":") ++ if self.get_option("all_known_locations"): ++ locations += list(Jars.extra_jar_locations) ++ ++ # append also user-defined locations, if any ++ user_locations = self.get_option("append_locations") ++ if user_locations: ++ locations += user_locations.split(":") + + # find all JARs in given locations + for location in locations: +-- +2.7.5 + +From d33c63a230092e94f966551968c51e8c5760742f Mon Sep 17 00:00:00 2001 +From: Michal Srb +Date: Mon, 21 Aug 2017 18:11:04 +0200 +Subject: [PATCH 2/2] [jars] Catch zipfile.BadZipfile exception + +Bad ZIP files can raise zipfile.BadZipfile exception. + +Fixes: +Traceback (most recent call last): + File "/home/msrb/projects/sos/sos/sosreport.py", line 1252, in setup + plug.setup() + File "/home/msrb/projects/sos/sos/plugins/jars.py", line 72, in setup + if Jars.is_jar(path): + File "/home/msrb/projects/sos/sos/plugins/jars.py", line 98, in is_jar + with zipfile.ZipFile(path) as f: + File "/usr/lib64/python2.7/zipfile.py", line 770, in __init__ + self._RealGetContents() + File "/usr/lib64/python2.7/zipfile.py", line 842, in _RealGetContents + raise BadZipfile("Bad magic number for central directory") +BadZipfile: Bad magic number for central directory + +Signed-off-by: Michal Srb +--- + sos/plugins/jars.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sos/plugins/jars.py b/sos/plugins/jars.py +index 486ac05..8c6b54f 100644 +--- a/sos/plugins/jars.py ++++ b/sos/plugins/jars.py +@@ -98,7 +98,7 @@ class Jars(Plugin, RedHatPlugin): + with zipfile.ZipFile(path) as f: + if "META-INF/MANIFEST.MF" in f.namelist(): + return True +- except IOError: ++ except (IOError, zipfile.BadZipfile): + pass + return False + +-- +2.7.5 + diff --git a/SOURCES/sos-bz1491964-gluster-block-plugin.patch b/SOURCES/sos-bz1491964-gluster-block-plugin.patch new file mode 100644 index 0000000..b968fc5 --- /dev/null +++ b/SOURCES/sos-bz1491964-gluster-block-plugin.patch @@ -0,0 +1,90 @@ +From 07e6ce3ee1f18a09fa8eaa77fc10729c970bf5f6 Mon Sep 17 00:00:00 2001 +From: vredara +Date: Thu, 29 Jun 2017 00:36:37 +0530 +Subject: [PATCH] [gluster_block] Added new plugin gluster_block (#1041) + +gluster_block plugin collects config/log files related to blocks + +Signed-off-by: venkata edara +Signed-off-by: Adam Stokes +--- + sos/plugins/gluster_block.py | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + create mode 100644 sos/plugins/gluster_block.py + +diff --git a/sos/plugins/gluster_block.py b/sos/plugins/gluster_block.py +new file mode 100644 +index 0000000..39efbd7 +--- /dev/null ++++ b/sos/plugins/gluster_block.py +@@ -0,0 +1,39 @@ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++ ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++ ++# You should have received a copy of the GNU General Public License along ++# with this program; if not, write to the Free Software Foundation, Inc., ++# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++import glob ++from sos.plugins import Plugin, RedHatPlugin ++ ++ ++class GlusterBlock(Plugin, RedHatPlugin): ++ """Gluster Block""" ++ ++ plugin_name = 'gluster_block' ++ profiles = ('storage',) ++ packages = ("gluster-block",) ++ files = ("/usr/sbin/gluster-block",) ++ ++ def setup(self): ++ ++ # collect logs - apply log_size for any individual file ++ # all_logs takes precedence over logsize ++ if not self.get_option("all_logs"): ++ limit = self.get_option("log_size") ++ else: ++ limit = 0 ++ ++ if limit: ++ for f in glob.glob("/var/log/gluster-block/*.log"): ++ self.add_copy_spec(f, limit) ++ else: ++ self.add_copy_spec("/var/log/gluster-block") +-- +2.7.5 + +From 9c3302597630e601213561b7f6dba8def0fcc448 Mon Sep 17 00:00:00 2001 +From: vredara +Date: Thu, 29 Jun 2017 00:38:01 +0530 +Subject: [PATCH] [targetcli] added one item (#1044) + +collecting the /sys/kernel/config/target + +Signed-off-by: venkata edara +Signed-off-by: Adam Stokes +--- + sos/plugins/targetcli.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sos/plugins/targetcli.py b/sos/plugins/targetcli.py +index 14be1bf..2a93379 100644 +--- a/sos/plugins/targetcli.py ++++ b/sos/plugins/targetcli.py +@@ -31,6 +31,7 @@ class TargetCli(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + "systemctl status target.service" + ]) + self.add_journal(units="targetcli") ++ self.add_copy_spec("/sys/kernel/config/target") + self.add_copy_spec("/etc/target") + + # vim: set et ts=4 sw=4 : +-- +2.7.5 + diff --git a/SOURCES/sos-bz1511087-openstack-containerized-further-updates.patch b/SOURCES/sos-bz1511087-openstack-containerized-further-updates.patch new file mode 100644 index 0000000..e500171 --- /dev/null +++ b/SOURCES/sos-bz1511087-openstack-containerized-further-updates.patch @@ -0,0 +1,936 @@ +From 4d1e5ffd2e6e4e9b4d4509af212c11a9ead58740 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Thu, 12 Oct 2017 14:22:55 +0200 +Subject: [PATCH] [openstack_[glance|heat]] run commands only if service is + running + +Collect "glance-manage db_version" and similar commands from the +two plugins only if the relevant services are running. Otherwise +the commands get stuck and timeout. + +Resolves: #1124 + +Signed-off-by: Pavel Moravec +--- + sos/plugins/openstack_glance.py | 29 +++++++++++++++++------------ + sos/plugins/openstack_heat.py | 40 +++++++++++++++++++++++----------------- + 2 files changed, 40 insertions(+), 29 deletions(-) + +diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py +index 0a2bdc1bb..642b4593a 100644 +--- a/sos/plugins/openstack_glance.py ++++ b/sos/plugins/openstack_glance.py +@@ -31,12 +31,6 @@ class OpenStackGlance(Plugin): + var_puppet_gen = "/var/lib/config-data/puppet-generated/glance_api" + + def setup(self): +- # Glance +- self.add_cmd_output( +- "glance-manage db_version", +- suggest_filename="glance_db_version" +- ) +- + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): + self.add_copy_spec([ +@@ -64,12 +58,23 @@ def setup(self): + vars_any = [p in os.environ for p in [ + 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] + +- if not (all(vars_all) and any(vars_any)): +- self.soslog.warning("Not all environment variables set. Source " +- "the environment file for the user intended " +- "to connect to the OpenStack environment.") +- else: +- self.add_cmd_output("openstack image list --long") ++ # collect commands output only if the openstack-glance-api service ++ # is running ++ service_status = self.get_command_output( ++ "systemctl status openstack-glance-api.service" ++ ) ++ if service_status['status'] == 0: ++ self.add_cmd_output( ++ "glance-manage db_version", ++ suggest_filename="glance_db_version" ++ ) ++ if not (all(vars_all) and any(vars_any)): ++ self.soslog.warning("Not all environment variables set. " ++ "Source the environment file for the user " ++ "intended to connect to the OpenStack " ++ "environment.") ++ else: ++ self.add_cmd_output("openstack image list --long") + + def postproc(self): + protect_keys = [ +diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py +index a73916b25..66a7f4109 100644 +--- a/sos/plugins/openstack_heat.py ++++ b/sos/plugins/openstack_heat.py +@@ -29,24 +29,30 @@ class OpenStackHeat(Plugin): + var_puppet_gen = "/var/lib/config-data/puppet-generated/heat" + + def setup(self): +- # Heat +- self.add_cmd_output( +- "heat-manage db_version", +- suggest_filename="heat_db_version" +- ) +- +- vars_all = [p in os.environ for p in [ +- 'OS_USERNAME', 'OS_PASSWORD']] + +- vars_any = [p in os.environ for p in [ +- 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] +- +- if not (all(vars_all) and any(vars_any)): +- self.soslog.warning("Not all environment variables set. Source " +- "the environment file for the user intended " +- "to connect to the OpenStack environment.") +- else: +- self.add_cmd_output("openstack stack list") ++ # collect commands output only if the openstack-heat-api service ++ # is running ++ service_status = self.get_command_output("systemctl status " ++ "openstack-heat-api.service") ++ if service_status['status'] == 0: ++ self.add_cmd_output( ++ "heat-manage db_version", ++ suggest_filename="heat_db_version" ++ ) ++ ++ vars_all = [p in os.environ for p in [ ++ 'OS_USERNAME', 'OS_PASSWORD']] ++ ++ vars_any = [p in os.environ for p in [ ++ 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ ++ if not (all(vars_all) and any(vars_any)): ++ self.soslog.warning("Not all environment variables set. " ++ "Source the environment file for the user " ++ "intended to connect to the OpenStack " ++ "environment.") ++ else: ++ self.add_cmd_output("openstack stack list") + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +From d5ac6cd768acbd6a8d2d1de2ec26f127272089f2 Mon Sep 17 00:00:00 2001 +From: Martin Schuppert +Date: Wed, 18 Oct 2017 15:50:23 +0200 +Subject: [PATCH] [openstack_*, logrotate] Tripleo additional directories + +Tripleo Pike opinionated config+log paths to be collected +for services, when running in containers. + +This is an addition to #1054 where a couple of things got missed + +Fixes: #1130 + +Signed-off-by: Martin Schuppert +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/gnocchi.py | 6 ++++-- + sos/plugins/logrotate.py | 6 +++++- + sos/plugins/openstack_cinder.py | 34 ++++++++++++++++++++++++------- + sos/plugins/openstack_glance.py | 6 ++++-- + sos/plugins/openstack_heat.py | 8 ++++++-- + sos/plugins/openstack_horizon.py | 6 ++++-- + sos/plugins/openstack_ironic.py | 43 +++++++++++++++++++++++++++++++-------- + sos/plugins/openstack_keystone.py | 6 ++++-- + sos/plugins/openstack_manila.py | 12 ++++++++--- + sos/plugins/openstack_neutron.py | 10 ++++++--- + sos/plugins/openstack_nova.py | 19 ++++++++++++++--- + sos/plugins/openstack_swift.py | 6 ++++-- + 13 files changed, 160 insertions(+), 43 deletions(-) + +diff --git a/sos/plugins/gnocchi.py b/sos/plugins/gnocchi.py +index c7a97097c..d2eda47ea 100644 +--- a/sos/plugins/gnocchi.py ++++ b/sos/plugins/gnocchi.py +@@ -49,13 +49,15 @@ def setup(self): + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/gnocchi/*", +- "/var/log/containers/gnocchi/*"], ++ "/var/log/containers/gnocchi/*", ++ "/var/log/containers/httpd/gnocchi-api/*"], + sizelimit=self.limit + ) + else: + self.add_copy_spec([ + "/var/log/gnocchi/*.log", +- "/var/log/containers/gnocchi/*.log"], ++ "/var/log/containers/gnocchi/*.log", ++ "/var/log/containers/httpd/gnocchi-api/*log"], + sizelimit=self.limit + ) + +diff --git a/sos/plugins/logrotate.py b/sos/plugins/logrotate.py +index c811192f0..c12cf1bb4 100644 +--- a/sos/plugins/logrotate.py ++++ b/sos/plugins/logrotate.py +@@ -22,12 +22,16 @@ class LogRotate(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): + plugin_name = 'logrotate' + profiles = ('system',) + ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/crond" ++ + def setup(self): + self.add_cmd_output("logrotate --debug /etc/logrotate.conf", + suggest_filename="logrotate_debug") + self.add_copy_spec([ + "/etc/logrotate*", +- "/var/lib/logrotate.status" ++ "/var/lib/logrotate.status", ++ self.var_puppet_gen + "/etc/logrotate-crond.conf", ++ self.var_puppet_gen + "/var/spool/cron/root" + ]) + + # vim: set et ts=4 sw=4 : +diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py +index ffec62b53..abfd267bb 100644 +--- a/sos/plugins/openstack_cinder.py ++++ b/sos/plugins/openstack_cinder.py +@@ -30,23 +30,39 @@ class OpenStackCinder(Plugin): + option_list = [("db", "gathers openstack cinder db version", "slow", + False)] + ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/cinder" ++ + def setup(self): + if self.get_option("db"): + self.add_cmd_output( + "cinder-manage db version", + suggest_filename="cinder_db_version") + +- self.add_copy_spec(["/etc/cinder/"]) ++ self.add_copy_spec([ ++ "/etc/cinder/", ++ self.var_puppet_gen + "/etc/cinder/", ++ self.var_puppet_gen + "/etc/httpd/conf/", ++ self.var_puppet_gen + "/etc/httpd/conf.d/", ++ self.var_puppet_gen + "/etc/httpd/conf.modules.d/*.conf", ++ self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf", ++ self.var_puppet_gen + "/etc/sysconfig/", ++ ]) + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/cinder/", +- "/var/log/containers/cinder/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/cinder/", ++ "/var/log/httpd/cinder*", ++ "/var/log/containers/cinder/", ++ "/var/log/containers/httpd/cinder-api/" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/cinder/*.log", +- "/var/log/containers/cinder/*.log"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/cinder/*.log", ++ "/var/log/httpd/cinder*.log", ++ "/var/log/containers/cinder/*.log", ++ "/var/log/containers/httpd/cinder-api/*log" ++ ], sizelimit=self.limit) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +@@ -67,6 +83,10 @@ def postproc(self): + + regexp = r"((?m)^\s*(%s)\s*=\s*)(.*)" % "|".join(protect_keys) + self.do_path_regex_sub("/etc/cinder/*", regexp, r"\1*********") ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "/etc/cinder/*", ++ regexp, r"\1*********" ++ ) + + + class DebianCinder(OpenStackCinder, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py +index 642b4593a..fdd789a81 100644 +--- a/sos/plugins/openstack_glance.py ++++ b/sos/plugins/openstack_glance.py +@@ -35,12 +35,14 @@ def setup(self): + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/glance/", +- "/var/log/containers/glance/" ++ "/var/log/containers/glance/", ++ "/var/log/containers/httpd/glance-api/" + ], sizelimit=self.limit) + else: + self.add_copy_spec([ + "/var/log/glance/*.log", +- "/var/log/containers/glance/*.log" ++ "/var/log/containers/glance/*.log", ++ "/var/log/containers/httpd/glance-api/*log" + ], sizelimit=self.limit) + + self.add_copy_spec([ +diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py +index 66a7f4109..de34ed155 100644 +--- a/sos/plugins/openstack_heat.py ++++ b/sos/plugins/openstack_heat.py +@@ -58,12 +58,16 @@ def setup(self): + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/heat/", +- "/var/log/containers/heat/" ++ "/var/log/containers/heat/", ++ "/var/log/containers/httpd/heat-api/", ++ "/var/log/containers/httpd/heat-api-cfn" + ], sizelimit=self.limit) + else: + self.add_copy_spec([ + "/var/log/heat/*.log", +- "/var/log/containers/heat/*.log" ++ "/var/log/containers/heat/*.log", ++ "/var/log/containers/httpd/heat-api/*log", ++ "/var/log/containers/httpd/heat-api-cfn/*log" + ], sizelimit=self.limit) + + self.add_copy_spec([ +diff --git a/sos/plugins/openstack_horizon.py b/sos/plugins/openstack_horizon.py +index a9a7fab3b..d4f457115 100644 +--- a/sos/plugins/openstack_horizon.py ++++ b/sos/plugins/openstack_horizon.py +@@ -35,12 +35,14 @@ def setup(self): + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/horizon/", +- "/var/log/containers/horizon/" ++ "/var/log/containers/horizon/", ++ "/var/log/containers/httpd/horizon/" + ], sizelimit=self.limit) + else: + self.add_copy_spec([ + "/var/log/horizon/*.log", +- "/var/log/containers/horizon/*.log" ++ "/var/log/containers/horizon/*.log", ++ "/var/log/containers/httpd/horizon/*log" + ], sizelimit=self.limit) + + self.add_copy_spec([ +diff --git a/sos/plugins/openstack_ironic.py b/sos/plugins/openstack_ironic.py +index 0396cc639..f4e0a97d3 100644 +--- a/sos/plugins/openstack_ironic.py ++++ b/sos/plugins/openstack_ironic.py +@@ -25,21 +25,48 @@ class OpenStackIronic(Plugin): + plugin_name = "openstack_ironic" + profiles = ('openstack', 'openstack_undercloud') + ++ var_puppet_gen = "/var/lib/config-data/puppet-generated/ironic" ++ + def setup(self): +- self.conf_list = ['/etc/ironic/*'] +- self.add_copy_spec('/etc/ironic/') ++ self.conf_list = [ ++ "/etc/ironic/*", ++ self.var_puppet_gen + "/etc/ironic/*", ++ self.var_puppet_gen + "_api/etc/ironic/*" ++ ] ++ self.add_copy_spec([ ++ "/etc/ironic/", ++ self.var_puppet_gen + "/etc/xinetd.conf", ++ self.var_puppet_gen + "/etc/xinetd.d/", ++ self.var_puppet_gen + "/etc/ironic/", ++ self.var_puppet_gen + "/etc/httpd/conf/", ++ self.var_puppet_gen + "/etc/httpd/conf.d/", ++ self.var_puppet_gen + "/etc/httpd/conf.modules.d/*.conf", ++ self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf", ++ self.var_puppet_gen + "_api/etc/ironic/", ++ self.var_puppet_gen + "_api/etc/httpd/conf/", ++ self.var_puppet_gen + "_api/etc/httpd/conf.d/", ++ self.var_puppet_gen + "_api/etc/httpd/conf.modules.d/*.conf", ++ self.var_puppet_gen + "_api/etc/my.cnf.d/tripleo.cnf" ++ ]) + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +- self.add_copy_spec(["/var/log/ironic/", +- "/var/log/containers/ironic/"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/ironic/", ++ "/var/log/containers/ironic/", ++ "/var/log/containers/httpd/ironic-api/" ++ ], sizelimit=self.limit) + else: +- self.add_copy_spec(["/var/log/ironic/*.log", +- "/var/log/containers/ironic/*.log"], +- sizelimit=self.limit) ++ self.add_copy_spec([ ++ "/var/log/ironic/*.log", ++ "/var/log/containers/ironic/*.log", ++ "/var/log/containers/httpd/ironic-api/*log" ++ ], sizelimit=self.limit) + + self.add_cmd_output('ls -laRt /var/lib/ironic/') ++ self.add_cmd_output( ++ 'ls -laRt ' + self.var_puppet_gen + '/var/lib/ironic/' ++ ) + + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) +diff --git a/sos/plugins/openstack_keystone.py b/sos/plugins/openstack_keystone.py +index d0b144323..72c7f8e2a 100644 +--- a/sos/plugins/openstack_keystone.py ++++ b/sos/plugins/openstack_keystone.py +@@ -47,12 +47,14 @@ class OpenStackKeystone(Plugin): + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/keystone/", +- "/var/log/containers/keystone/" ++ "/var/log/containers/keystone/", ++ "/var/log/containers/httpd/keystone/" + ], sizelimit=self.limit) + else: + self.add_copy_spec([ + "/var/log/keystone/*.log", +- "/var/log/containers/keystone/*.log" ++ "/var/log/containers/keystone/*.log", ++ "/var/log/containers/httpd/keystone/*log" + ], sizelimit=self.limit) + + if self.get_option("verify"): +diff --git a/sos/plugins/openstack_manila.py b/sos/plugins/openstack_manila.py +index 92bca6fa8..e29859367 100644 +--- a/sos/plugins/openstack_manila.py ++++ b/sos/plugins/openstack_manila.py +@@ -29,19 +29,25 @@ class OpenStackManila(Plugin): + def setup(self): + self.add_copy_spec([ + "/etc/manila/", +- self.var_puppet_gen + "/etc/manila/" ++ self.var_puppet_gen + "/etc/manila/", ++ self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf", ++ self.var_puppet_gen + "/etc/httpd/conf/", ++ self.var_puppet_gen + "/etc/httpd/conf.d/", ++ self.var_puppet_gen + "/etc/httpd/conf.modules.d/*.conf", + ]) + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/manila/*", +- "/var/log/containers/manila/*" ++ "/var/log/containers/manila/*", ++ "/var/log/containers/httpd/manila-api/*" + ], sizelimit=self.limit) + else: + self.add_copy_spec([ + "/var/log/manila/*.log", +- "/var/log/containers/manila/*.log" ++ "/var/log/containers/manila/*.log", ++ "/var/log/containers/httpd/manila-api/*log" + ], sizelimit=self.limit) + + def postproc(self): +diff --git a/sos/plugins/openstack_neutron.py b/sos/plugins/openstack_neutron.py +index b6116c731..522686606 100644 +--- a/sos/plugins/openstack_neutron.py ++++ b/sos/plugins/openstack_neutron.py +@@ -33,17 +33,21 @@ def setup(self): + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/neutron/", +- "/var/log/containers/neutron/" ++ "/var/log/containers/neutron/", ++ "/var/log/containers/httpd/neutron-api/" + ], sizelimit=self.limit) + else: + self.add_copy_spec([ + "/var/log/neutron/*.log", +- "/var/log/containers/neutron/*.log" ++ "/var/log/containers/neutron/*.log", ++ "/var/log/containers/httpd/neutron-api/*log" + ], sizelimit=self.limit) + + self.add_copy_spec([ + "/etc/neutron/", +- self.var_puppet_gen + "/etc/neutron/" ++ self.var_puppet_gen + "/etc/neutron/", ++ self.var_puppet_gen + "/etc/default/neutron-server", ++ self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf" + ]) + self.add_copy_spec("/var/lib/neutron/") + if self.get_option("verify"): +diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py +index 75dd37255..1fbfa76a8 100644 +--- a/sos/plugins/openstack_nova.py ++++ b/sos/plugins/openstack_nova.py +@@ -71,12 +71,16 @@ def setup(self): + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/nova/", +- "/var/log/containers/nova/" ++ "/var/log/containers/nova/", ++ "/var/log/containers/httpd/nova-api/", ++ "/var/log/containers/httpd/nova-placement/" + ], sizelimit=self.limit) + else: + self.add_copy_spec([ + "/var/log/nova/*.log", +- "/var/log/containers/nova/*.log" ++ "/var/log/containers/nova/*.log", ++ "/var/log/containers/httpd/nova-api/*log", ++ "/var/log/containers/httpd/nova-placement/*log" + ], sizelimit=self.limit) + + self.add_copy_spec([ +@@ -89,7 +93,12 @@ def setup(self): + self.var_puppet_gen + "_placement/etc/httpd/conf.d/", + self.var_puppet_gen + "_placement/etc/httpd/conf.modules.d/*.conf", + self.var_puppet_gen + "_placement/etc/my.cnf.d/tripleo.cnf", +- self.var_puppet_gen + "/../memcached/etc/sysconfig/memcached" ++ self.var_puppet_gen + "/../memcached/etc/sysconfig/memcached", ++ self.var_puppet_gen + "_libvirt/etc/libvirt/", ++ self.var_puppet_gen + "_libvirt/etc/my.cnf.d/tripleo.cnf", ++ self.var_puppet_gen + "_libvirt/etc/nova/migration/" ++ "authorized_keys", ++ self.var_puppet_gen + "_libvirt/var/lib/nova/.ssh/config", + ]) + + if self.get_option("verify"): +@@ -115,6 +124,10 @@ def postproc(self): + self.var_puppet_gen + "_placement/etc/nova/*", + regexp, r"\1*********" + ) ++ self.do_path_regex_sub( ++ self.var_puppet_gen + "_libvirt/etc/nova/*", ++ regexp, r"\1*********" ++ ) + + + class DebianNova(OpenStackNova, DebianPlugin, UbuntuPlugin): +diff --git a/sos/plugins/openstack_swift.py b/sos/plugins/openstack_swift.py +index 1cfff2b88..1688112f5 100644 +--- a/sos/plugins/openstack_swift.py ++++ b/sos/plugins/openstack_swift.py +@@ -35,12 +35,14 @@ def setup(self): + if self.get_option("all_logs"): + self.add_copy_spec([ + "/var/log/swift/", +- "/var/log/containers/swift/" ++ "/var/log/containers/swift/", ++ "/var/log/containers/httpd/swift-proxy/" + ], sizelimit=self.limit) + else: + self.add_copy_spec([ + "/var/log/swift/*.log", +- "/var/log/containers/swift/*.log" ++ "/var/log/containers/swift/*.log", ++ "/var/log/containers/httpd/swift-proxy/*log" + ], sizelimit=self.limit) + + self.add_copy_spec([ +From e63c17d902f99d96cbd4cb2a06d9cbbf8a4d4c18 Mon Sep 17 00:00:00 2001 +From: Martin Schuppert +Date: Tue, 7 Nov 2017 18:07:47 +0100 +Subject: [PATCH] [openstack_nova] added missing nova container config + +Tripleo Pike opinionated config+log paths to be collected +for services, when running in containers. + +The nova configuration for the nova and placement container +was included, but the nova configuration libvirt container +was missing. Also the httpd configs for the nova contaier +were added. + +This is a change to #1130 + +Signed-off-by: Martin Schuppert mschuppe@redhat.com +--- + sos/plugins/openstack_nova.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py +index 1fbfa76a8..cdd297608 100644 +--- a/sos/plugins/openstack_nova.py ++++ b/sos/plugins/openstack_nova.py +@@ -87,7 +87,10 @@ def setup(self): + "/etc/nova/", + self.var_puppet_gen + "/etc/nova/", + self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf", +- self.var_puppet_gen + "_placement/var/spool/cron/nova", ++ self.var_puppet_gen + "/var/spool/cron/nova", ++ self.var_puppet_gen + "/etc/httpd/conf/", ++ self.var_puppet_gen + "/etc/httpd/conf.d/", ++ self.var_puppet_gen + "/etc/httpd/conf.modules.d/*.conf", + self.var_puppet_gen + "_placement/etc/nova/", + self.var_puppet_gen + "_placement/etc/httpd/conf/", + self.var_puppet_gen + "_placement/etc/httpd/conf.d/", +@@ -96,6 +99,7 @@ def setup(self): + self.var_puppet_gen + "/../memcached/etc/sysconfig/memcached", + self.var_puppet_gen + "_libvirt/etc/libvirt/", + self.var_puppet_gen + "_libvirt/etc/my.cnf.d/tripleo.cnf", ++ self.var_puppet_gen + "_libvirt/etc/nova/", + self.var_puppet_gen + "_libvirt/etc/nova/migration/" + "authorized_keys", + self.var_puppet_gen + "_libvirt/var/lib/nova/.ssh/config", +From 410733862a1f5ea1f9666d1fa41a7b5d3390e3c6 Mon Sep 17 00:00:00 2001 +From: Martin Schuppert +Date: Wed, 8 Nov 2017 17:57:54 +0100 +Subject: [PATCH] [openstack_[glance|heat|cinder|nova]] limit command run + +Collect "glance-manage db_version" and similar commands from the +four plugins only if the relevant services or containers are +running. Otherwise the commands get stuck and timeout. + +This is an enhancement to #1124 to check for containers + do the +same for nova + cinder. + +Signed-off-by: Martin Schuppert mschuppe@redhat.com + +Edited to remove use of shell syntax. + +Fixes: #1139 + +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/openstack_cinder.py | 30 ++++++++++--- + sos/plugins/openstack_glance.py | 33 +++++++++++---- + sos/plugins/openstack_heat.py | 23 ++++++++-- + sos/plugins/openstack_nova.py | 94 +++++++++++++++++++++++++++-------------- + 4 files changed, 129 insertions(+), 51 deletions(-) + +diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py +index abfd267bb..a023105c8 100644 +--- a/sos/plugins/openstack_cinder.py ++++ b/sos/plugins/openstack_cinder.py +@@ -27,16 +27,34 @@ class OpenStackCinder(Plugin): + plugin_name = "openstack_cinder" + profiles = ('openstack', 'openstack_controller') + +- option_list = [("db", "gathers openstack cinder db version", "slow", +- False)] +- + var_puppet_gen = "/var/lib/config-data/puppet-generated/cinder" + + def setup(self): +- if self.get_option("db"): ++ ++ # collect commands output only if the openstack-cinder-api service ++ # is running ++ service_status = self.get_command_output( ++ "systemctl status openstack-cinder-api.service" ++ ) ++ ++ container_status = self.get_command_output("docker ps") ++ in_container = False ++ if container_status['status'] == 0: ++ for line in container_status['output'].splitlines(): ++ if line.endswith("cinder_api"): ++ in_container = True ++ ++ if (service_status['status'] == 0) or in_container: ++ cinder_config = "" ++ # if containerized we need to pass the config to the cont. ++ if in_container: ++ cinder_config = "--config-dir " + self.var_puppet_gen + \ ++ "/etc/cinder/" ++ + self.add_cmd_output( +- "cinder-manage db version", +- suggest_filename="cinder_db_version") ++ "cinder-manage " + cinder_config + " db version", ++ suggest_filename="cinder_db_version" ++ ) + + self.add_copy_spec([ + "/etc/cinder/", +diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py +index fdd789a81..4cdc6dc62 100644 +--- a/sos/plugins/openstack_glance.py ++++ b/sos/plugins/openstack_glance.py +@@ -54,22 +54,37 @@ def setup(self): + if self.get_option("verify"): + self.add_cmd_output("rpm -V %s" % ' '.join(self.packages)) + +- vars_all = [p in os.environ for p in [ +- 'OS_USERNAME', 'OS_PASSWORD']] +- +- vars_any = [p in os.environ for p in [ +- 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] +- + # collect commands output only if the openstack-glance-api service + # is running + service_status = self.get_command_output( +- "systemctl status openstack-glance-api.service" ++ "systemctl status openstack-glance-api.service" + ) +- if service_status['status'] == 0: ++ ++ container_status = self.get_command_output("docker ps") ++ in_container = False ++ if container_status['status'] == 0: ++ for line in container_status['output'].splitlines(): ++ if line.endswith("cinder_api"): ++ in_container = True ++ ++ if (service_status['status'] == 0) or in_container: ++ glance_config = "" ++ # if containerized we need to pass the config to the cont. ++ if in_container: ++ glance_config = "--config-dir " + self.var_puppet_gen + \ ++ "/etc/glance/" ++ + self.add_cmd_output( +- "glance-manage db_version", ++ "glance-manage " + glance_config + " db_version", + suggest_filename="glance_db_version" + ) ++ ++ vars_all = [p in os.environ for p in [ ++ 'OS_USERNAME', 'OS_PASSWORD']] ++ ++ vars_any = [p in os.environ for p in [ ++ 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ + if not (all(vars_all) and any(vars_any)): + self.soslog.warning("Not all environment variables set. " + "Source the environment file for the user " +diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py +index de34ed155..e3395fabd 100644 +--- a/sos/plugins/openstack_heat.py ++++ b/sos/plugins/openstack_heat.py +@@ -32,11 +32,26 @@ def setup(self): + + # collect commands output only if the openstack-heat-api service + # is running +- service_status = self.get_command_output("systemctl status " +- "openstack-heat-api.service") +- if service_status['status'] == 0: ++ service_status = self.get_command_output( ++ "systemctl status openstack-heat-api.service" ++ ) ++ ++ container_status = self.get_command_output("docker ps") ++ in_container = False ++ if container_status['status'] == 0: ++ for line in container_status['output'].splitlines(): ++ if line.endswith("cinder_api"): ++ in_container = True ++ ++ if (service_status['status'] == 0) or in_container: ++ heat_config = "" ++ # if containerized we need to pass the config to the cont. ++ if in_container: ++ heat_config = "--config-dir " + self.var_puppet_gen + \ ++ "_api/etc/heat/" ++ + self.add_cmd_output( +- "heat-manage db_version", ++ "heat-manage " + heat_config + " db_version", + suggest_filename="heat_db_version" + ) + +diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py +index cdd297608..e8839a2a6 100644 +--- a/sos/plugins/openstack_nova.py ++++ b/sos/plugins/openstack_nova.py +@@ -32,40 +32,70 @@ class OpenStackNova(Plugin): + var_puppet_gen = "/var/lib/config-data/puppet-generated/nova" + + def setup(self): +- # commands we do not need to source the environment file +- self.add_cmd_output("nova-manage db version") +- self.add_cmd_output("nova-manage fixed list") +- self.add_cmd_output("nova-manage floating list") + +- vars_all = [p in os.environ for p in [ +- 'OS_USERNAME', 'OS_PASSWORD']] +- +- vars_any = [p in os.environ for p in [ +- 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ # collect commands output only if the openstack-nova-api service ++ # is running ++ service_status = self.get_command_output( ++ "systemctl status openstack-nova-api.service" ++ ) + +- if not (all(vars_all) and any(vars_any)): +- self.soslog.warning("Not all environment variables set. Source " +- "the environment file for the user intended " +- "to connect to the OpenStack environment.") +- else: +- self.add_cmd_output("nova service-list") +- self.add_cmd_output("openstack flavor list --long") +- self.add_cmd_output("nova network-list") +- self.add_cmd_output("nova list") +- self.add_cmd_output("nova agent-list") +- self.add_cmd_output("nova version-list") +- self.add_cmd_output("nova host-list") +- self.add_cmd_output("openstack quota show") +- self.add_cmd_output("openstack hypervisor stats show") +- # get details for each nova instance +- cmd = "openstack server list -f value" +- nova_instances = self.call_ext_prog(cmd)['output'] +- for instance in nova_instances.splitlines(): +- instance = instance.split()[0] +- cmd = "openstack server show %s" % (instance) +- self.add_cmd_output( +- cmd, +- suggest_filename="instance-" + instance + ".log") ++ container_status = self.get_command_output("docker ps") ++ in_container = False ++ if container_status['status'] == 0: ++ for line in container_status['output'].splitlines(): ++ if line.endswith("cinder_api"): ++ in_container = True ++ ++ if (service_status['status'] == 0) or in_container: ++ nova_config = "" ++ # if containerized we need to pass the config to the cont. ++ if in_container: ++ nova_config = "--config-dir " + self.var_puppet_gen + \ ++ "/etc/nova/" ++ ++ self.add_cmd_output( ++ "nova-manage " + nova_config + " db version", ++ suggest_filename="nova-manage_db_version" ++ ) ++ self.add_cmd_output( ++ "nova-manage " + nova_config + " fixed list", ++ suggest_filename="nova-manage_fixed_list" ++ ) ++ self.add_cmd_output( ++ "nova-manage " + nova_config + " floating list", ++ suggest_filename="nova-manage_floating_list" ++ ) ++ ++ vars_all = [p in os.environ for p in [ ++ 'OS_USERNAME', 'OS_PASSWORD']] ++ ++ vars_any = [p in os.environ for p in [ ++ 'OS_TENANT_NAME', 'OS_PROJECT_NAME']] ++ ++ if not (all(vars_all) and any(vars_any)): ++ self.soslog.warning("Not all environment variables set. " ++ "Source the environment file for the user " ++ "intended to connect to the OpenStack " ++ "environment.") ++ else: ++ self.add_cmd_output("nova service-list") ++ self.add_cmd_output("openstack flavor list --long") ++ self.add_cmd_output("nova network-list") ++ self.add_cmd_output("nova list") ++ self.add_cmd_output("nova agent-list") ++ self.add_cmd_output("nova version-list") ++ self.add_cmd_output("nova hypervisor-list") ++ self.add_cmd_output("openstack quota show") ++ self.add_cmd_output("openstack hypervisor stats show") ++ # get details for each nova instance ++ cmd = "openstack server list -f value" ++ nova_instances = self.call_ext_prog(cmd)['output'] ++ for instance in nova_instances.splitlines(): ++ instance = instance.split()[0] ++ cmd = "openstack server show %s" % (instance) ++ self.add_cmd_output( ++ cmd, ++ suggest_filename="instance-" + instance + ".log") + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): +From 2140b1611565078c4a6536782c013a525722e0da Mon Sep 17 00:00:00 2001 +From: Martin Schuppert +Date: Thu, 21 Dec 2017 08:00:41 +0100 +Subject: [PATCH] [openstack_glance|heat|nova] fix api container names + +Container names of glance, heat and nova api was not correct +when verify if a the container is running. + +Signed-off-by: Martin Schuppert +--- + sos/plugins/openstack_glance.py | 2 +- + sos/plugins/openstack_heat.py | 2 +- + sos/plugins/openstack_nova.py | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py +index 4cdc6dc62..d7588abe0 100644 +--- a/sos/plugins/openstack_glance.py ++++ b/sos/plugins/openstack_glance.py +@@ -64,7 +64,7 @@ def setup(self): + in_container = False + if container_status['status'] == 0: + for line in container_status['output'].splitlines(): +- if line.endswith("cinder_api"): ++ if line.endswith("glance_api"): + in_container = True + + if (service_status['status'] == 0) or in_container: +diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py +index e3395fabd..0cf7c8595 100644 +--- a/sos/plugins/openstack_heat.py ++++ b/sos/plugins/openstack_heat.py +@@ -40,7 +40,7 @@ def setup(self): + in_container = False + if container_status['status'] == 0: + for line in container_status['output'].splitlines(): +- if line.endswith("cinder_api"): ++ if line.endswith("heat_api"): + in_container = True + + if (service_status['status'] == 0) or in_container: +diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py +index e8839a2a6..951e69cba 100644 +--- a/sos/plugins/openstack_nova.py ++++ b/sos/plugins/openstack_nova.py +@@ -43,7 +43,7 @@ def setup(self): + in_container = False + if container_status['status'] == 0: + for line in container_status['output'].splitlines(): +- if line.endswith("cinder_api"): ++ if line.endswith("nova_api"): + in_container = True + + if (service_status['status'] == 0) or in_container: +From 8ce70c4d3683ce977f1243c56b7d4f4b6782c0df Mon Sep 17 00:00:00 2001 +From: Martin Schuppert +Date: Fri, 29 Dec 2017 09:20:33 +0100 +Subject: [PATCH] [openstack_cinder] check for api service running via + cinder_wsgi + +With OSP11 cinder api changed to run via https wsgi. To check for +running cinder-manage command we also need to take this situation. +The change checks for cinder_wsgi process. + +Signed-off-by: Martin Schuppert +--- + sos/plugins/openstack_cinder.py | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py +index a023105c8..6b292d279 100644 +--- a/sos/plugins/openstack_cinder.py ++++ b/sos/plugins/openstack_cinder.py +@@ -37,14 +37,23 @@ def setup(self): + "systemctl status openstack-cinder-api.service" + ) + ++ ps_status = self.get_command_output("ps -ef") ++ in_ps = False ++ if ps_status['status'] == 0: ++ for line in ps_status['output'].splitlines(): ++ if "cinder_wsgi" in line: ++ in_ps = True ++ break ++ + container_status = self.get_command_output("docker ps") + in_container = False + if container_status['status'] == 0: + for line in container_status['output'].splitlines(): + if line.endswith("cinder_api"): + in_container = True ++ break + +- if (service_status['status'] == 0) or in_container: ++ if (service_status['status'] == 0) or in_container or in_ps: + cinder_config = "" + # if containerized we need to pass the config to the cont. + if in_container: diff --git a/SOURCES/sos-bz1515113-postgresql-from-scl.patch b/SOURCES/sos-bz1515113-postgresql-from-scl.patch new file mode 100644 index 0000000..7c33175 --- /dev/null +++ b/SOURCES/sos-bz1515113-postgresql-from-scl.patch @@ -0,0 +1,868 @@ +From 138bc243aa592cd628f6e41a1b3c35f1f01f3c37 Mon Sep 17 00:00:00 2001 +From: "Bryn M. Reeves" +Date: Tue, 8 Aug 2017 16:48:40 +0100 +Subject: [PATCH] [Plugin] add executable command enablement checks + +Add a new list/tuple member to the Plugin class that contains a +list of executable commands that will enable the plugin if any +are present. + +For example, a plugin: + + class MyPlugin(Plugin, RedHatPlugin): + + commands = ('mycmd1', 'mycmd2') + +Will be automatically enabled if either 'mycmd1' or 'mycmd2' +is present and executable in the policy defined PATH for the +run. + +Related: #1051. + +Signed-off-by: Bryn M. Reeves +--- + sos/plugins/__init__.py | 27 ++++++++++++++++++--------- + 1 file changed, 18 insertions(+), 9 deletions(-) + +diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py +index a31297f6c..2d6f6ff58 100644 +--- a/sos/plugins/__init__.py ++++ b/sos/plugins/__init__.py +@@ -19,7 +19,7 @@ + from __future__ import with_statement + + from sos.utilities import (sos_get_command_output, import_module, grep, +- fileobj, tail) ++ fileobj, tail, is_executable) + import os + import glob + import re +@@ -111,6 +111,7 @@ class Plugin(object): + version = 'unversioned' + packages = () + files = () ++ commands = () + archive = None + profiles = () + sysroot = '/' +@@ -865,23 +866,31 @@ def get_description(self): + + def check_enabled(self): + """This method will be used to verify that a plugin should execute +- given the condition of the underlying environment. The default +- implementation will return True if neither class.files or +- class.packages is specified. If either are specified the plugin will +- check for the existence of any of the supplied files or packages and +- return True if any exist. It is encouraged to override this method if +- this behavior isn't applicable. ++ given the condition of the underlying environment. ++ ++ The default implementation will return True if none of class.files, ++ class.packages, nor class.commands is specified. If any of these is ++ specified the plugin will check for the existence of any of the ++ corresponding paths, packages or commands and return True if any ++ are present. ++ ++ For plugins with more complex enablement checks this method may be ++ overridden. + """ + # some files or packages have been specified for this package +- if self.files or self.packages: ++ if any([self.files, self.packages, self.commands]): + if isinstance(self.files, six.string_types): + self.files = [self.files] + + if isinstance(self.packages, six.string_types): + self.packages = [self.packages] + ++ if isinstance(self.commands, six.string_types): ++ self.commands = [self.commands] ++ + return (any(os.path.exists(fname) for fname in self.files) or +- any(self.is_installed(pkg) for pkg in self.packages)) ++ any(self.is_installed(pkg) for pkg in self.packages) or ++ any(is_executable(cmd) for cmd in self.commands)) + return True + + def default_enabled(self): +From 947e7089c58ac239bc2fd535ac0c77f93f11b895 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Tue, 3 Oct 2017 15:39:43 +0200 +Subject: [PATCH] [plugins] Add class SCLPlugin for Software Collections + support + +Related to #900 and #1090 + +Original author: Bohuslav Kabrda +Signed-off-by: Pavel Moravec +--- + sos/plugins/__init__.py | 109 ++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 106 insertions(+), 3 deletions(-) + +diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py +index 61a3083e3..540d46596 100644 +--- a/sos/plugins/__init__.py ++++ b/sos/plugins/__init__.py +@@ -884,6 +884,10 @@ def check_enabled(self): + corresponding paths, packages or commands and return True if any + are present. + ++ For SCLPlugin subclasses, it will check whether the plugin can be run ++ for any of installed SCLs. If so, it will store names of these SCLs ++ on the plugin class in addition to returning True. ++ + For plugins with more complex enablement checks this method may be + overridden. + """ +@@ -898,11 +902,34 @@ def check_enabled(self): + if isinstance(self.commands, six.string_types): + self.commands = [self.commands] + +- return (any(os.path.exists(fname) for fname in self.files) or +- any(self.is_installed(pkg) for pkg in self.packages) or +- any(is_executable(cmd) for cmd in self.commands)) ++ if isinstance(self, SCLPlugin): ++ # save SCLs that match files or packages ++ type(self)._scls_matched = [] ++ for scl in self._get_scls(): ++ files = [f % {"scl_name": scl} for f in self.files] ++ packages = [p % {"scl_name": scl} for p in self.packages] ++ commands = [c % {"scl_name": scl} for c in self.commands] ++ if self._files_pkgs_or_cmds_present(files, ++ packages, ++ commands): ++ type(self)._scls_matched.append(scl) ++ return len(type(self)._scls_matched) > 0 ++ ++ return self._files_pkgs_or_cmds_present(self.files, ++ self.packages, ++ self.commands) ++ ++ if isinstance(self, SCLPlugin): ++ # if files and packages weren't specified, we take all SCLs ++ type(self)._scls_matched = self._get_scls() ++ + return True + ++ def _files_pkgs_or_cmds_present(self, files, packages, commands): ++ 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)) ++ + def default_enabled(self): + """This decides whether a plugin should be automatically loaded or + only if manually specified in the command line.""" +@@ -979,6 +1006,82 @@ class RedHatPlugin(object): + pass + + ++class SCLPlugin(RedHatPlugin): ++ """Superclass for plugins operating on Software Collections (SCLs). ++ ++ Subclasses of this plugin class can specify class.files and class.packages ++ using "%(scl_name)s" interpolation. The plugin invoking mechanism will try ++ to match these against all found SCLs on the system. SCLs that do match ++ class.files or class.packages are then accessible via self.scls_matched ++ when the plugin is invoked. ++ ++ Additionally, this plugin class provides "add_cmd_output_scl" (run ++ a command in context of given SCL), and "add_copy_spec_scl" and ++ "add_copy_spec_limit_scl" (copy package from file system of given SCL). ++ ++ For example, you can implement a plugin that will list all global npm ++ packages in every SCL that contains "npm" package: ++ ++ class SCLNpmPlugin(Plugin, SCLPlugin): ++ packages = ("%(scl_name)s-npm",) ++ ++ def setup(self): ++ for scl in self.scls_matched: ++ self.add_cmd_output_scl(scl, "npm ls -g --json") ++ """ ++ ++ @property ++ def scls_matched(self): ++ if not hasattr(type(self), '_scls_matched'): ++ type(self)._scls_matched = [] ++ return type(self)._scls_matched ++ ++ def _get_scls(self): ++ output = sos_get_command_output("scl -l")["output"] ++ return [scl.strip() for scl in output.splitlines()] ++ ++ def add_cmd_output_scl(self, scl, cmds, **kwargs): ++ """Same as add_cmd_output, except that it wraps command in ++ "scl enable" call. ++ """ ++ if isinstance(cmds, six.string_types): ++ cmds = [cmds] ++ scl_cmds = [] ++ scl_cmd_tpl = "scl enable %s \"%s\"" ++ for cmd in cmds: ++ scl_cmds.append(scl_cmd_tpl % (scl, cmd)) ++ self.add_cmd_output(scl_cmds, **kwargs) ++ ++ # config files for Software Collections are under /etc/opt/rh/${scl} and ++ # var files are under /var/opt/rh/${scl}. So we need to insert the paths ++ # after the appropriate root dir. ++ def convert_copyspec_scl(self, scl, copyspec): ++ for rootdir in ['etc', 'var']: ++ p = re.compile('^/%s/' % rootdir) ++ copyspec = p.sub('/%s/opt/rh/%s/' % (rootdir, scl), copyspec) ++ return copyspec ++ ++ def add_copy_spec_scl(self, scl, copyspecs): ++ """Same as add_copy_spec, except that it prepends path to SCL root ++ to "copyspecs". ++ """ ++ if isinstance(copyspecs, six.string_types): ++ copyspecs = [copyspecs] ++ scl_copyspecs = [] ++ for copyspec in copyspecs: ++ scl_copyspecs.append(self.convert_copyspec_scl(scl, copyspec)) ++ self.add_copy_spec(scl_copyspecs) ++ ++ def add_copy_spec_limit_scl(self, scl, copyspec, **kwargs): ++ """Same as add_copy_spec_limit, except that it prepends path to SCL ++ root to "copyspec". ++ """ ++ self.add_copy_spec_limit( ++ self.convert_copyspec_scl(scl, copyspec), ++ **kwargs ++ ) ++ ++ + class PowerKVMPlugin(RedHatPlugin): + """Tagging class for IBM PowerKVM Linux""" + pass +From 62d6435198403abb65b925e7bf63fc39f5394e6d Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Mon, 16 Oct 2017 13:20:44 +0200 +Subject: [PATCH] [postgresql] Collect data for postgreSQL from RHSCL + +Collect postgreSQL data also when postgreSQL is installed from +Red Hat Software Collections. + +Resolves: #1090 + +Signed-off-by: Pavel Moravec +--- + sos/plugins/postgresql.py | 117 +++++++++++++++++++++++++--------------------- + 1 file changed, 65 insertions(+), 52 deletions(-) + +diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py +index 345532223..45c87e890 100644 +--- a/sos/plugins/postgresql.py ++++ b/sos/plugins/postgresql.py +@@ -1,3 +1,4 @@ ++# Copyright (C) 2017 Red Hat, Inc., Pavel Moravec + # Copyright (C) 2014 Red Hat, Inc., Sandro Bonazzola + # Copyright (C) 2013 Chris J Arges + # Copyright (C) 2012-2013 Red Hat, Inc., Bryn M. Reeves +@@ -20,7 +21,8 @@ + import os + import tempfile + +-from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin ++from sos.plugins import (Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin, ++ SCLPlugin) + from sos.utilities import find + + +@@ -45,47 +47,43 @@ class PostgreSQL(Plugin): + ('dbport', 'database server port number', '', '5432') + ] + +- def pg_dump(self): +- dest_file = os.path.join(self.tmp_dir, "sos_pgdump.tar") +- # We're only modifying this for ourself and our children so there +- # is no need to save and restore environment variables if the user +- # decided to pass the password on the command line. +- if self.get_option("password") is not False: +- os.environ["PGPASSWORD"] = str(self.get_option("password")) +- +- if self.get_option("dbhost"): +- cmd = "pg_dump -U %s -h %s -p %s -w -f %s -F t %s" % ( +- self.get_option("username"), +- self.get_option("dbhost"), +- self.get_option("dbport"), +- dest_file, +- self.get_option("dbname") +- ) +- else: +- cmd = "pg_dump -C -U %s -w -f %s -F t %s " % ( +- self.get_option("username"), +- dest_file, +- self.get_option("dbname") +- ) +- +- result = self.call_ext_prog(cmd) +- if (result['status'] == 0): +- self.add_copy_spec(dest_file) +- else: +- self._log_error( +- "Unable to execute pg_dump. Error(%s)" % (result['output']) +- ) +- self.add_alert( +- "ERROR: Unable to execute pg_dump. Error(%s)" % +- (result['output']) +- ) +- +- def setup(self): ++ def pg_dump(self, pg_dump_command="pg_dump", filename="sos_pgdump.tar"): + if self.get_option("dbname"): + if self.get_option("password") or "PGPASSWORD" in os.environ: + self.tmp_dir = tempfile.mkdtemp() +- self.pg_dump() +- else: ++ dest_file = os.path.join(self.tmp_dir, filename) ++ # We're only modifying this for ourself and our children so ++ # there is no need to save and restore environment variables if ++ # the user decided to pass the password on the command line. ++ if self.get_option("password") is not False: ++ os.environ["PGPASSWORD"] = str(self.get_option("password")) ++ ++ if self.get_option("dbhost"): ++ cmd = "%s -U %s -h %s -p %s -w -f %s -F t %s" % ( ++ pg_dump_command, ++ self.get_option("username"), ++ self.get_option("dbhost"), ++ self.get_option("dbport"), ++ dest_file, ++ self.get_option("dbname") ++ ) ++ else: ++ cmd = "%s -C -U %s -w -f %s -F t %s " % ( ++ pg_dump_command, ++ self.get_option("username"), ++ dest_file, ++ self.get_option("dbname") ++ ) ++ ++ result = self.call_ext_prog(cmd) ++ if (result['status'] == 0): ++ self.add_copy_spec(dest_file) ++ else: ++ self._log_info( ++ "Unable to execute pg_dump. Error(%s)" % ++ (result['output']) ++ ) ++ else: # no password in env or options + self.soslog.warning( + "password must be supplied to dump a database." + ) +@@ -93,6 +91,9 @@ def setup(self): + "WARN: password must be supplied to dump a database." + ) + ++ def setup(self): ++ self.pg_dump() ++ + def postproc(self): + import shutil + if self.tmp_dir: +@@ -105,33 +106,45 @@ def postproc(self): + self.add_alert("ERROR: Unable to remove %s." % (self.tmp_dir)) + + +-class RedHatPostgreSQL(PostgreSQL, RedHatPlugin): ++class RedHatPostgreSQL(PostgreSQL, SCLPlugin): ++ ++ packages = ('postgresql', 'rh-postgresql95-postgresql-server', ) + + def setup(self): + super(RedHatPostgreSQL, self).setup() + ++ scl = "rh-postgresql95" ++ pghome = self.get_option("pghome") ++ + # Copy PostgreSQL log files. +- for filename in find("*.log", self.get_option("pghome")): ++ for filename in find("*.log", pghome): ++ self.add_copy_spec(filename) ++ for filename in find("*.log", self.convert_copyspec_scl(scl, pghome)): + self.add_copy_spec(filename) ++ + # Copy PostgreSQL config files. +- for filename in find("*.conf", self.get_option("pghome")): ++ for filename in find("*.conf", pghome): ++ self.add_copy_spec(filename) ++ for filename in find("*.conf", self.convert_copyspec_scl(scl, pghome)): + self.add_copy_spec(filename) + +- self.add_copy_spec( +- os.path.join( +- self.get_option("pghome"), +- "data", +- "PG_VERSION" +- ) +- ) +- self.add_copy_spec( +- os.path.join( +- self.get_option("pghome"), ++ self.add_copy_spec(os.path.join(pghome, "data", "PG_VERSION")) ++ self.add_copy_spec(os.path.join(pghome, "data", "postmaster.opts")) ++ ++ self.add_copy_spec_scl(scl, os.path.join(pghome, "data", "PG_VERSION")) ++ self.add_copy_spec_scl(scl, os.path.join( ++ pghome, + "data", + "postmaster.opts" + ) + ) + ++ if scl in self.scls_matched: ++ self.pg_dump( ++ pg_dump_command="scl enable rh-postgresql95 -- pg_dump", ++ filename="sos_scl_pgdump.tar" ++ ) ++ + + class DebianPostgreSQL(PostgreSQL, DebianPlugin, UbuntuPlugin): + +From 0b93d1f69ccfcc76e1896ea0e5ff7854be69be13 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Sat, 25 Nov 2017 12:47:35 +0100 +Subject: [PATCH] [plugins] set proper PATH for SCL commands + +As SCL packages are deployed under /opt/${provider}/${scl}/, +calling a SCL command needs that prefix in any path in PATH. + +Consequently, distro-specific SCL default path prefix of the provider must be +defined in sos policies. + +Relevant to: #1154 + +Signed-off-by: Pavel Moravec +--- + sos/plugins/__init__.py | 37 ++++++++++++++++++++++++++++++------- + sos/policies/__init__.py | 4 ++++ + sos/policies/redhat.py | 1 + + 3 files changed, 35 insertions(+), 7 deletions(-) + +diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py +index aa69b19d..2a8bc516 100644 +--- a/sos/plugins/__init__.py ++++ b/sos/plugins/__init__.py +@@ -1066,25 +1066,48 @@ class SCLPlugin(RedHatPlugin): + output = sos_get_command_output("scl -l")["output"] + return [scl.strip() for scl in output.splitlines()] + ++ def convert_cmd_scl(self, scl, cmd): ++ """wrapping command in "scl enable" call and adds proper PATH ++ """ ++ # load default SCL prefix to PATH ++ prefix = self.policy().get_default_scl_prefix() ++ # read prefix from /etc/scl/prefixes/${scl} and strip trailing '\n' ++ try: ++ prefix = open('/etc/scl/prefixes/%s' % scl, 'r').read()\ ++ .rstrip('\n') ++ except Exception as e: ++ self._log_error("Failed to find prefix for SCL %s, using %s" ++ % (scl, prefix)) ++ ++ # expand PATH by equivalent prefixes under the SCL tree ++ path = os.environ["PATH"] ++ for p in path.split(':'): ++ path = '%s/%s%s:%s' % (prefix, scl, p, path) ++ ++ scl_cmd = "scl enable %s \"PATH=%s %s\"" % (scl, path, cmd) ++ return scl_cmd ++ + def add_cmd_output_scl(self, scl, cmds, **kwargs): + """Same as add_cmd_output, except that it wraps command in +- "scl enable" call. ++ "scl enable" call and sets proper PATH. + """ + if isinstance(cmds, six.string_types): + cmds = [cmds] + scl_cmds = [] +- scl_cmd_tpl = "scl enable %s \"%s\"" + for cmd in cmds: +- scl_cmds.append(scl_cmd_tpl % (scl, cmd)) ++ scl_cmds.append(convert_cmd_scl(scl, cmd)) + self.add_cmd_output(scl_cmds, **kwargs) + +- # config files for Software Collections are under /etc/opt/rh/${scl} and +- # var files are under /var/opt/rh/${scl}. So we need to insert the paths +- # after the appropriate root dir. ++ # config files for Software Collections are under /etc/${prefix}/${scl} and ++ # var files are under /var/${prefix}/${scl} where the ${prefix} is distro ++ # specific path. So we need to insert the paths after the appropriate root ++ # dir. + def convert_copyspec_scl(self, scl, copyspec): ++ scl_prefix = self.policy().get_default_scl_prefix() + for rootdir in ['etc', 'var']: + p = re.compile('^/%s/' % rootdir) +- copyspec = p.sub('/%s/opt/rh/%s/' % (rootdir, scl), copyspec) ++ copyspec = p.sub('/%s/%s/%s/' % (rootdir, scl_prefix, scl), ++ copyspec) + return copyspec + + def add_copy_spec_scl(self, scl, copyspecs): +diff --git a/sos/policies/__init__.py b/sos/policies/__init__.py +index dffd801c..dc043105 100644 +--- a/sos/policies/__init__.py ++++ b/sos/policies/__init__.py +@@ -194,6 +194,7 @@ No changes will be made to system configuration. + vendor_url = "http://www.example.com/" + vendor_text = "" + PATH = "" ++ default_scl_prefix = "" + + _in_container = False + _host_sysroot = '/' +@@ -271,6 +272,9 @@ No changes will be made to system configuration. + return tempfile.gettempdir() + return opt_tmp_dir + ++ def get_default_scl_prefix(self): ++ return self.default_scl_prefix ++ + def match_plugin(self, plugin_classes): + if len(plugin_classes) > 1: + for p in plugin_classes: +diff --git a/sos/policies/redhat.py b/sos/policies/redhat.py +index c7449439..2dfe0589 100644 +--- a/sos/policies/redhat.py ++++ b/sos/policies/redhat.py +@@ -44,6 +44,7 @@ class RedHatPolicy(LinuxPolicy): + _rpmq_cmd = 'rpm -qa --queryformat "%{NAME}|%{VERSION}\\n"' + _in_container = False + _host_sysroot = '/' ++ default_scl_prefix = '/opt/rh' + + def __init__(self, sysroot=None): + super(RedHatPolicy, self).__init__(sysroot=sysroot) +-- +2.13.6 + +From 419ebe48ea408b6596ff4d7d9837079dc3057fcf Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Sat, 25 Nov 2017 12:58:16 +0100 +Subject: [PATCH] [postgresql] Call SCL pg_dump with proper path + +Also stop storing pg_dump in an auxiliary tempdir but under regular +sos_commands/postgresql directory. + +Resolves: #1154 + +Signed-off-by: Pavel Moravec +--- + sos/plugins/postgresql.py | 43 ++++++++----------------------------------- + 1 file changed, 8 insertions(+), 35 deletions(-) + +diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py +index 45c87e89..9ba696be 100644 +--- a/sos/plugins/postgresql.py ++++ b/sos/plugins/postgresql.py +@@ -34,8 +34,6 @@ class PostgreSQL(Plugin): + + packages = ('postgresql',) + +- tmp_dir = None +- + password_warn_text = " (password visible in process listings)" + + option_list = [ +@@ -47,11 +45,9 @@ class PostgreSQL(Plugin): + ('dbport', 'database server port number', '', '5432') + ] + +- def pg_dump(self, pg_dump_command="pg_dump", filename="sos_pgdump.tar"): ++ def do_pg_dump(self, scl=None, filename="pgdump.tar"): + if self.get_option("dbname"): + if self.get_option("password") or "PGPASSWORD" in os.environ: +- self.tmp_dir = tempfile.mkdtemp() +- dest_file = os.path.join(self.tmp_dir, filename) + # We're only modifying this for ourself and our children so + # there is no need to save and restore environment variables if + # the user decided to pass the password on the command line. +@@ -59,30 +55,21 @@ class PostgreSQL(Plugin): + os.environ["PGPASSWORD"] = str(self.get_option("password")) + + if self.get_option("dbhost"): +- cmd = "%s -U %s -h %s -p %s -w -f %s -F t %s" % ( +- pg_dump_command, ++ cmd = "pg_dump -U %s -h %s -p %s -w -F t %s" % ( + self.get_option("username"), + self.get_option("dbhost"), + self.get_option("dbport"), +- dest_file, + self.get_option("dbname") + ) + else: +- cmd = "%s -C -U %s -w -f %s -F t %s " % ( +- pg_dump_command, ++ cmd = "pg_dump -C -U %s -w -F t %s " % ( + self.get_option("username"), +- dest_file, + self.get_option("dbname") + ) + +- result = self.call_ext_prog(cmd) +- if (result['status'] == 0): +- self.add_copy_spec(dest_file) +- else: +- self._log_info( +- "Unable to execute pg_dump. Error(%s)" % +- (result['output']) +- ) ++ if scl is not None: ++ cmd = self.convert_cmd_scl(scl, cmd) ++ self.add_cmd_output(cmd, suggest_filename=filename) + else: # no password in env or options + self.soslog.warning( + "password must be supplied to dump a database." +@@ -92,18 +79,7 @@ class PostgreSQL(Plugin): + ) + + def setup(self): +- self.pg_dump() +- +- def postproc(self): +- import shutil +- if self.tmp_dir: +- try: +- shutil.rmtree(self.tmp_dir) +- except shutil.Error: +- self.soslog.exception( +- "Unable to remove %s." % (self.tmp_dir) +- ) +- self.add_alert("ERROR: Unable to remove %s." % (self.tmp_dir)) ++ self.do_pg_dump() + + + class RedHatPostgreSQL(PostgreSQL, SCLPlugin): +@@ -140,10 +116,7 @@ class RedHatPostgreSQL(PostgreSQL, SCLPlugin): + ) + + if scl in self.scls_matched: +- self.pg_dump( +- pg_dump_command="scl enable rh-postgresql95 -- pg_dump", +- filename="sos_scl_pgdump.tar" +- ) ++ self.do_pg_dump(scl=scl, filename="pgdump-scl-%s.tar" % scl) + + + class DebianPostgreSQL(PostgreSQL, DebianPlugin, UbuntuPlugin): +-- +2.13.6 + +From ede50e9cb4a5f2755eaeaf608fb2b3708f911422 Mon Sep 17 00:00:00 2001 +From: Pavel Moravec +Date: Wed, 20 Dec 2017 11:47:33 +0100 +Subject: [PATCH] [plugins] allow add_cmd_output to collect binary output + +If a command output is a true binary data, allow add_cmd_output to +collect the raw content and dont try to decode it as UTF-8. + +Resolves: #1169 + +Signed-off-by: Pavel Moravec +--- + sos/archive.py | 16 ++++++++++------ + sos/plugins/__init__.py | 33 ++++++++++++++++++--------------- + sos/plugins/postgresql.py | 3 ++- + sos/utilities.py | 5 +++-- + 4 files changed, 33 insertions(+), 24 deletions(-) + +diff --git a/sos/archive.py b/sos/archive.py +index 607312a71..4bc2bedea 100644 +--- a/sos/archive.py ++++ b/sos/archive.py +@@ -82,7 +82,7 @@ def log_debug(self, msg): + def add_file(self, src, dest=None): + raise NotImplementedError + +- def add_string(self, content, dest): ++ def add_string(self, content, dest, treat_binary): + raise NotImplementedError + + def add_link(self, source, link_name): +@@ -198,12 +198,14 @@ def add_file(self, src, dest=None): + self.log_debug("added %s to FileCacheArchive '%s'" % + (file_name, self._archive_root)) + +- def add_string(self, content, dest): ++ def add_string(self, content, dest, treat_binary=False): + src = dest + dest = self.dest_path(dest) + self._check_path(dest) +- f = codecs.open(dest, 'w', encoding='utf-8') +- if isinstance(content, bytes): ++ f = codecs.open(dest, ++ 'wb' if treat_binary else 'w', ++ encoding=None if treat_binary else 'utf-8') ++ if isinstance(content, bytes) and not treat_binary: + content = content.decode('utf8', 'ignore') + f.write(content) + if os.path.exists(src): +@@ -212,8 +214,10 @@ def add_string(self, content, dest): + except OSError as e: + self.log_error( + "Unable to add '%s' to FileCacheArchive: %s" % (dest, e)) +- self.log_debug("added string at '%s' to FileCacheArchive '%s'" +- % (src, self._archive_root)) ++ self.log_debug("added %sstring at '%s' to FileCacheArchive '%s'" ++ % ('binary ' if treat_binary else '', ++ src, ++ self._archive_root)) + + def add_link(self, source, link_name): + dest = self.dest_path(link_name) +diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py +index 2a8bc516e..156f5ed36 100644 +--- a/sos/plugins/__init__.py ++++ b/sos/plugins/__init__.py +@@ -587,7 +587,8 @@ def getmtime(path): + self.archive.add_link(link_path, _file) + + def get_command_output(self, prog, timeout=300, stderr=True, +- chroot=True, runat=None, env=None): ++ chroot=True, runat=None, env=None, ++ treat_binary=False): + if chroot or self.commons['cmdlineopts'].chroot == 'always': + root = self.sysroot + else: +@@ -595,7 +596,7 @@ def get_command_output(self, prog, timeout=300, stderr=True, + + result = sos_get_command_output(prog, timeout=timeout, stderr=stderr, + chroot=root, chdir=runat, +- env=env) ++ env=env, treat_binary=treat_binary) + + if result['status'] == 124: + self._log_warn("command '%s' timed out after %ds" +@@ -586,7 +586,8 @@ class Plugin(object): + % (prog.split()[0], root)) + return self.get_command_output(prog, timeout=timeout, + chroot=False, runat=runat, +- env=env) ++ env=env, ++ treat_binary=treat_binary) + self._log_debug("could not run '%s': command not found" % prog) + return result + +@@ -632,14 +634,14 @@ def check_ext_prog(self, prog): + + def _add_cmd_output(self, cmd, suggest_filename=None, + root_symlink=None, timeout=300, stderr=True, +- chroot=True, runat=None, env=None): ++ chroot=True, runat=None, env=None, treat_binary=False): + """Internal helper to add a single command to the collection list.""" + cmdt = ( + cmd, suggest_filename, + root_symlink, timeout, stderr, +- chroot, runat, env ++ chroot, runat, env, treat_binary + ) +- _tuplefmt = "('%s', '%s', '%s', %s, '%s', '%s', '%s', '%s')" ++ _tuplefmt = "('%s', '%s', '%s', %s, '%s', '%s', '%s', '%s', '%s')" + _logstr = "packed command tuple: " + _tuplefmt + self._log_debug(_logstr % cmdt) + self.collect_cmds.append(cmdt) +@@ -647,7 +649,7 @@ def _add_cmd_output(self, cmd, suggest_filename=None, + + def add_cmd_output(self, cmds, suggest_filename=None, + root_symlink=None, timeout=300, stderr=True, +- chroot=True, runat=None, env=None): ++ chroot=True, runat=None, env=None, treat_binary=False): + """Run a program or a list of programs and collect the output""" + if isinstance(cmds, six.string_types): + cmds = [cmds] +@@ -656,7 +658,7 @@ def add_cmd_output(self, cmds, suggest_filename=None, + for cmd in cmds: + self._add_cmd_output(cmd, suggest_filename, + root_symlink, timeout, stderr, +- chroot, runat, env) ++ chroot, runat, env, treat_binary) + + def get_cmd_output_path(self, name=None, make=True): + """Return a path into which this module should store collected +@@ -683,14 +684,15 @@ class Plugin(object): + + def get_cmd_output_now(self, exe, suggest_filename=None, + root_symlink=False, timeout=300, stderr=True, +- chroot=True, runat=None, env=None): ++ chroot=True, runat=None, env=None, ++ treat_binary=False): + """Execute a command and save the output to a file for inclusion in the + report. + """ + start = time() + result = self.get_command_output(exe, timeout=timeout, stderr=stderr, + chroot=chroot, runat=runat, +- env=env) ++ env=env, treat_binary=treat_binary) + # 126 means 'found but not executable' + if result['status'] == 126 or result['status'] == 127: + return None +@@ -729,7 +732,7 @@ def get_cmd_output_now(self, exe, suggest_filename=None, + outfn = self._make_command_filename(exe) + + outfn_strip = outfn[len(self.commons['cmddir'])+1:] +- self.archive.add_string(result['output'], outfn) ++ self.archive.add_string(result['output'], outfn, treat_binary) + if root_symlink: + self.archive.add_link(outfn, root_symlink) + +@@ -839,16 +842,16 @@ def _collect_cmd_output(self): + timeout, + stderr, + chroot, runat, +- env ++ env, treat_binary + ) = progs[0] +- self._log_debug("unpacked command tuple: " + +- "('%s', '%s', '%s', %s, '%s', '%s', '%s', '%s')" % +- progs[0]) ++ self._log_debug(("unpacked command tuple: " + ++ "('%s', '%s', '%s', %s, '%s', '%s', '%s', '%s'," + ++ "'%s')") % progs[0]) + self._log_info("collecting output of '%s'" % prog) + self.get_cmd_output_now(prog, suggest_filename=suggest_filename, + root_symlink=root_symlink, timeout=timeout, + stderr=stderr, chroot=chroot, runat=runat, +- env=env) ++ env=env, treat_binary=treat_binary) + + def _collect_strings(self): + for string, file_name in self.copy_strings: +diff --git a/sos/plugins/postgresql.py b/sos/plugins/postgresql.py +index 9ba696be2..07db22fdd 100644 +--- a/sos/plugins/postgresql.py ++++ b/sos/plugins/postgresql.py +@@ -69,7 +69,8 @@ def do_pg_dump(self, scl=None, filename="pgdump.tar"): + + if scl is not None: + cmd = self.convert_cmd_scl(scl, cmd) +- self.add_cmd_output(cmd, suggest_filename=filename) ++ self.add_cmd_output(cmd, suggest_filename=filename, ++ treat_binary=True) + else: # no password in env or options + self.soslog.warning( + "password must be supplied to dump a database." +diff --git a/sos/utilities.py b/sos/utilities.py +index 55bb1dc96..a9040ba28 100644 +--- a/sos/utilities.py ++++ b/sos/utilities.py +@@ -110,7 +110,8 @@ def is_executable(command): + + + def sos_get_command_output(command, timeout=300, stderr=False, +- chroot=None, chdir=None, env=None): ++ chroot=None, chdir=None, env=None, ++ treat_binary=False): + """Execute a command and return a dictionary of status and output, + optionally changing root or current working directory before + executing command. +@@ -164,7 +165,7 @@ def _child_prep_fn(): + + return { + 'status': p.returncode, +- 'output': stdout.decode('utf-8', 'ignore') ++ 'output': stdout if treat_binary else stdout.decode('utf-8', 'ignore') + } + + diff --git a/SPECS/sos.spec b/SPECS/sos.spec new file mode 100644 index 0000000..fee0dc8 --- /dev/null +++ b/SPECS/sos.spec @@ -0,0 +1,799 @@ +%{!?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.4 +Release: 13%{?dist} +Group: Applications/System +Source0: https://github.com/sosreport/sos/archive/%{version}.tar.gz +License: GPLv2+ +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot +BuildArch: noarch +Url: http://github.com/sosreport/sos +BuildRequires: python-devel +BuildRequires: gettext +Requires: libxml2-python +Requires: python-six +Requires: bzip2 +Requires: xz +Obsoletes: sos-plugins-openstack +Patch0: skip-generating-doc.patch +Patch1: sos-bz1438257-collect-cmds-with-return-1.patch +Patch2: sos-bz1438269-ceph-collect-etc-calamari.patch +Patch3: sos-bz1444641-virsh-uncaught-exception.patch +Patch4: sos-bz1250346-openstack-tripleo.patch +Patch5: sos-bz1442078-container-test-oci.patch +Patch6: sos-bz1416535-pacemaker-user-logs.patch +Patch7: sos-bz1148381-libvirt-cgroups-collection.patch +Patch8: sos-bz1449904-ceph-tmp-mount-exclude.patch +Patch9: sos-bz1393961-missing-filesystem-nonfatal.patch +Patch10: sos-bz1400407-samba-dc-connect.patch +Patch11: sos-bz1470573-tripleo-add-ui-logs.patch +Patch12: sos-bz1463635-openstack-containerized-tripleo.patch +Patch13: sos-bz1482574-jars-redundant-os-walk.patch +Patch14: sos-bz1491964-gluster-block-plugin.patch +Patch15: sos-bz1511087-openstack-containerized-further-updates.patch +Patch16: sos-bz1515113-postgresql-from-scl.patch + +%description +Sos is a set of tools that gathers information about system +hardware and configuration. The information can then be used for +diagnostic purposes and debugging. Sos is commonly used to help +support technicians and developers. + +%prep +%setup -qn %{name}-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 +%patch16 -p1 + +%build +make + +%install +rm -rf ${RPM_BUILD_ROOT} +make DESTDIR=${RPM_BUILD_ROOT} install +%find_lang %{name} || echo 0 + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%files -f %{name}.lang +%defattr(-,root,root,-) +%{_sbindir}/sosreport +%{_datadir}/%{name} +%{python_sitelib}/* +%{_mandir}/man1/* +%{_mandir}/man5/* +%doc AUTHORS README.md LICENSE +%config(noreplace) %{_sysconfdir}/sos.conf + +%changelog +* Thu Jan 04 2018 Pavel Moravec = 3.4-13 +- [plugins] allow add_cmd_output to collect binary output + Resolves: bz1515113 + +* Thu Jan 04 2018 Pavel Moravec = 3.4-12 +- [openstack_cinder] check for api service running + Resolves: bz1511087 +- [plugins] allow add_cmd_output to collect binary output + Resolves: bz1515113 + +* Fri Dec 08 2017 Pavel Moravec = 3.4-11 +- [postgresql] Call SCL pg_dump with proper path + Resolves: bz1515113 + +* Mon Nov 20 2017 Pavel Moravec = 3.4-10 +- [postgresql] Collect data for postgreSQL from RHSCL + Resolves: bz1515113 + +* Wed Nov 15 2017 Pavel Moravec = 3.4-9 +- [openstack_*] further updates to OSP plugins in containers + Resolves: bz1511087 + +* Thu Oct 12 2017 Pavel Moravec = 3.4-8 +- [gnocchi] Tripleo specific containerized services logs + Resolves: bz1463635 + +* Tue Oct 10 2017 Pavel Moravec = 3.4-7 +- [openstack plugins] Tripleo specific containerized services + Resolves: bz1463635 +- [jars] Scan only /usr/{share,lib}/java by default + Resolves: bz1482574 +- [gluster_block] Added new plugin gluster_block + Resolves: bz1491964 + +* Wed Jul 12 2017 Pavel Moravec = 3.4-6 +- [tripleo] Add ui logs + Resolves: bz1470573 + +* Tue May 30 2017 Pavel Moravec = 3.4-5 +- [samba] Fix dc-connect winbind logfile path + Resolves: bz1400407 + +* Mon May 22 2017 Pavel Moravec = 3.4-4 +- [libvirt] fix per-process cgroup collection + Resolves: bz1148381 +- [ceph] exclude temporary mount locations from collection + Resolves: bz1449904 +- [policies/redhat] make missing 'filesystem' package non-fatal + Resolves: bz1393961 + +* Wed May 10 2017 Pavel Moravec = 3.4-3 +- [ceph] fix list formatting + Resolves: bz1438269 +- [virsh] Handle properly cases when virsh commands fail + Resolves: bz1444641 +- [openstack_*] fix issue with --verify option, extend pkglist for instack + Resolves: bz1250346 +- [policies/redhat] accept 'oci' as a valid container type + Resolves: bz1442078 +- [pacemaker] Collect user-defined logfile + Resolves: bz1416535 + +* Wed Apr 19 2017 Pavel Moravec = 3.4-2 +- [Pugin] revert 77eb4ab (do not return output from failed cmds) + Resolves: bz1438257 + +* Tue Mar 28 2017 Pavel Moravec = 3.4-1 +- New upstream release sos-3.4 + +* Fri Nov 04 2016 Pavel Moravec = 3.3-5 +- [networking] plugin crash with quotemark in network name + Resolves: bz1353992 + +* Fri Sep 09 2016 Pavel Moravec = 3.3-4 +- [networking][reporting] plugin tracebacks when net-tools missing + Resolves: bz1374152 + +* Fri Sep 02 2016 Pavel Moravec = 3.3-3 +- [nodejs][nms]: new plugins + Resolves: bz1368393 +- [docker]: Gather more data and expand plugin options + Resolves: bz1351647 + +* Fri Aug 19 2016 Pavel Moravec = 3.3-2 +- [grub2] grub2-mkconfig loads ext4 and brctl kernel + Resolves: bz1116670 +- [ceph] skip collecting of all keyring and bindpass files + Resolves: bz1260607 +- [omsa] add omreport storage controller + Resolves: bz1299603 +- [atomichost] fix collection of 'docker info' output + Resolves: bz1302146 +- [monit] fix add_copy_spec() arguments + Resolves: bz1356945 +- [virtwho] add new plugin for virt-who agent + Resolves: bz1353552 + +* Thu Jun 30 2016 Pavel Moravec = 3.3-1 +- New upstream release sos-3.3 + +* Wed Jun 29 2016 Pavel Moravec = 3.3-0 +- New upstream release (beta version) + +* Thu Jan 14 2016 Pavel Moravec = 3.2-37 +- [sosreport] prepare report in a private subdirectory (updated) + Resolves: bz1290955 + +* Mon Dec 14 2015 Pavel Moravec = 3.2-36 +- [ceph] collect /var/lib/ceph and /var/run/ceph + Resolves: bz1260607 +- [sosreport] prepare report in a private subdirectory + Resolves: bz1290955 + +* Wed Oct 07 2015 Pavel Moravec = 3.2-35 +- [docker] collect journald logs for docker unit + Resolves: bz1245770 + +* Tue Oct 06 2015 Pavel Moravec = 3.2-34 +- [sosreport] fix command-line report defaults + Resolves: bz1219720 + +* Thu Sep 10 2015 Pavel Moravec = 3.2-33 +- [openstack_neutron] obfuscate server_auth in restproxy.ini + Resolves: bz1243092 + +* Fri Aug 28 2015 Pavel Moravec = 3.2-32 +- [memory] collect swapon --show output in bytes + Resolves: bz1194159 + +* Mon Aug 24 2015 Pavel Moravec = 3.2-31 +- [sosreport] fix command-line report defaults (proper patch ordering) + Resolves: bz1219720 + +* Tue Aug 04 2015 Pavel Moravec = 3.2-30 +- [sapnw] call self methods properly + Resolves: bz1195608 + +* Tue Aug 04 2015 Pavel Moravec = 3.2-29 +- [openvswitch] capture the logs, db and OVS bridges details + Resolves: bz1242507 +- [logs] fix reference to missing 'rsyslog_conf' variable + Resolves: bz1249705 +- [sapnw] Add check if saphostctrl is not present, dont use Set + Resolves: bz1195608 +- [Plugin] fix handling of symlinks in non-sysroot environments + Resolves: bz1248672 + +* Sat Jul 18 2015 Pavel Moravec = 3.2-28 +- [openstack] Ensure openstack passwords and secrets are obfuscated + Resolves: bz1243092 + +* Wed Jul 15 2015 Pavel Moravec = 3.2-27 +- [plugin] pass stderr through _collect_cmd_output +- split dependencies of bz1185990 fix from bz1185990 patch + Resolves: bz1185990 + +* Thu Jul 09 2015 Pavel Moravec = 3.2-26 +- [kubernetes,plugin] Support running sos inside a container + Resolves: bz1185990 + +* Tue Jul 07 2015 Pavel Moravec = 3.2-25 +- [openstack] New Openstack Trove (DBaaS) plugin + Resolves: bz1238349 +- [services] Add more diagnostics to applications + Resolves: bz1195087 +- [openstack_neutron] Obscure passwords and secrets + Resolves: bz1240666 + +* Sat Jul 04 2015 Pavel Moravec = 3.2-23 +- [ceph] add calamari and ragos logs and configs + Resolves: bz1210527 +- [iprconfig] enable plugin for ppc64* architectures + Resolves: bz1238726 + +* Fri Jul 03 2015 Pavel Moravec = 3.2-22 +- [general] verify --profile contains valid plugins only + Resolves: bz1184602 +- [kernel,mpt,memory] additional kernel-related diagnostics + Resolves: bz1194159 + +* Wed Jul 01 2015 Pavel Moravec = 3.2-21 +- [cluster] enable crm_report password scrubbing + Resolves: bz1164864 +- [sosreport] fix command-line report defaults + Resolves: bz1219720 +- [virsh] add new plugin, add listing of qemu + Resolves: bz1195086 +- [sap*,vhostmd] new plugins for SAP + Resolves: bz1195608 + +* Tue Jun 30 2015 Pavel Moravec = 3.2-20 +- [cluster] crm_report fails to run because dir already exists + Resolves: bz1200526 +- [foreman] Skip collection of generic resources + Resolves: bz1135317 +- [apache] Added collection of conf.modules.d dir for httpd 2.4 + Resolves: bz1183265 +- [pcp] collect /etc/pcp.conf + Resolves: bz1183297 +- [puppet] adding new plugin for puppet + Resolves: bz1183768 +- [block] Don't use parted human readable output + Resolves: bz1183770 +- [general] Better handling --name and --ticket-number in + Resolves: bz1185093 +- [networking] additional ip, firewall and traffic shaping + Resolves: bz1194554 +- [infiniband] add opensm and infiniband-diags support + Resolves: bz1194556 +- [plugins/rabbitmq] Added cluster_status command output + Resolves: bz1197006 +- [networking] re-add 'ip addr' with a root symlink + Resolves: bz1209454 +- [kimchi] add new plugin + Resolves: bz1209840 +- [iprconfig] add plugin for IBM Power RAID adapters + Resolves: bz1221932 +- [ovirt] Collect engine tunables and domain information. + Resolves: bz1236101 +- [activemq] Honour all_logs and get config on RHEL + Resolves: bz1236111 +- [cluster] Add luci to packages for standalone luci servers + Resolves: bz1236124 +- [hpasm] hpasmcli commands hang under timeout + Resolves: bz1214209 +- [mysql] Collect log file + Resolves: bz1210906 +- [chrony] add chrony plugin + Resolves: bz1165418 + +* Mon Jun 15 2015 Shane Bradley = 3.2-19 +- [openstack_sahara] redact secrets from sahara configuration + Resolves: bz1211984 + +* Tue Jun 09 2015 Pavel Moravec = 3.2-18 +- [openstack_sahara] add new openstack_sahara plugin + Resolves: bz1211984 + +* Tue Apr 21 2015 Pavel Moravec = 3.2-17 +- [openstack_neutron] neutron configuration and logs files not captured + Resolves: bz1213315 +- [ovirt] remove ovirt-engine setup answer file password leak + Resolves: bz1162788 +- [networking] network plugin fails if NetworkManager is disabled + Resolves: bz1206633 + +* Fri Mar 13 2015 Pavel Moravec = 3.2-16 +- [cluster] crm_report fails to run because dir already exists + Resolves: bz1200526 + +* Thu Jan 22 2015 Bryn M. Reeves = 3.2-15 +- [mysql] improve handling of dbuser, dbpass and MYSQL_PWD + Resolves: bz1180919 + +* Tue Jan 20 2015 Bryn M. Reeves = 3.2-14 +- [mysql] test for boolean values in dbuser and dbpass + Resolves: bz1180919 + +* Mon Jan 19 2015 Bryn M. Reeves = 3.2-12 +- [plugin] limit path names to PC_NAME_MAX + Resolves: bz1026962 +- [squid] collect files from /var/log/squid + Resolves: bz1026962 +- [sosreport] log plugin exceptions to a file + Resolves: bz1026962 +- [ctdb] fix collection of /etc/sysconfig/ctdb + Resolves: bz1026962 +- [sosreport] fix silent exception handling + Resolves: bz1026962 + +* Tue Jan 13 2015 Bryn M. Reeves = 3.2-11 +- [sosreport] do not make logging calls after OSError + Resolves: bz1087977 +- [sosreport] catch OSError exceptions in SoSReport.execute() + Resolves: bz1087977 +- [anaconda] make useradd password regex tolerant of whitespace + Resolves: bz1112175 + +* Tue Dec 23 2014 Bryn M. Reeves = 3.2-10 +- [mysql] fix handling of mysql.dbpass option + Resolves: bz1126001 + +* Wed Dec 17 2014 Bryn M. Reeves = 3.2-9 +- [navicli] catch exceptions if stdin is unreadable + Resolves: bz1166039 +- [docs] update man page for new options + Resolves: bz1171658 +- [sosreport] make all utf-8 handling user errors=ignore + Resolves: bz1164267 + +* Tue Dec 09 2014 Bryn M. Reeves = 3.2-8 +- [kpatch] do not attempt to collect data if kpatch is not installed + Resolves: bz1110918 +- [archive] drop support for Zip archives + Resolves: bz1118152 + +* Thu Oct 30 2014 Bryn M. Reeves = 3.2-7 +- [sosreport] fix archive permissions regression + Resolves: bz1158891 + +* Mon Oct 20 2014 Bryn M. Reeves = 3.2-6 +- [tomcat] add support for tomcat7 and default log size limits + Resolves: bz1148375 +- [mysql] obtain database password from the environment + Resolves: bz1126001 + +* Wed Oct 15 2014 Bryn M. Reeves = 3.2-5 +- [corosync] add postprocessing for corosync-objctl output + Resolves: bz1087515 +- [ovirt_hosted_engine] fix exception when force-enabled + Resolves: bz1148551 + +* Thu Oct 02 2014 Bryn M. Reeves = 3.2-4 +- [yum] call rhsm-debug with --no-subscriptions + Resolves: bz1116349 +- [powerpc] allow PowerPC plugin to run on ppc64le + Resolves: bz1140427 +- [package] add Obsoletes for sos-plugins-openstack + Resolves: bz1140756 + +* Wed Oct 01 2014 Bryn M. Reeves = 3.2-3 +- [pam] add pam_tally2 and faillock support + Resolves: bz1127631 +- [postgresql] obtain db password from the environment + Resolves: bz1126001 +- [pcp] add Performance Co-Pilot plugin + Resolves: bz1119833 +- [nfsserver] collect /etc/exports.d + Resolves: bz1118921 +- [sosreport] handle --compression-type correctly + Resolves: bz1118152 +- [anaconda] redact passwords in kickstart configurations + Resolves: bz1112175 +- [haproxy] add new plugin + Resolves: bz1107865 +- [keepalived] add new plugin + Resolves: bz1105247 +- [lvm2] set locking_type=0 when calling lvm commands + Resolves: bz1102285 +- [tuned] add new plugin + Resolves: bz1095447 +- [cgroups] collect /etc/sysconfig/cgred + Resolves: bz1083677 +- [plugins] ensure doc text is always displayed for plugins + Resolves: bz1065473 +- [sosreport] fix the distribution version API call + Resolves: bz1028111 +- [docker] add new plugin + Resolves: bz1084990 +- [openstack_*] include broken-out openstack plugins + Resolves: bz1140756 +- [mysql] support MariaDB + Resolves: bz1106600 +- [openstack] do not collect /var/lib/nova + Resolves: bz1106423 +- [grub2] collect grub.cfg on UEFI systems + Resolves: bz1086648 +- [sosreport] handle out-of-space errors gracefully + Resolves: bz1087977 +- [firewalld] new plugin + Resolves: bz1100505 +- [networking] collect NetworkManager status + Resolves: bz1100505 +- [kpatch] new plugin + Resolves: bz1110918 +- [global] update to upstream 3.2 release + Resolves: bz1026962 + +* Mon Sep 08 2014 Bryn M. Reeves = 3.0-24 +- [foreman] add new plugin + Resolves: bz1130273 + +* Thu Mar 20 2014 Bryn M. Reeves = 3.0-23 +- Call rhsm-debug with the --sos switch + Resolves: bz1039036 + +* Mon Mar 03 2014 Bryn M. Reeves = 3.0-22 +- Fix package check in anacron plugin + Resolves: bz1067769 + +* Wed Feb 12 2014 Bryn M. Reeves = 3.0-21 +- Remove obsolete rhel_version() usage from yum plugin + Resolves: bz916705 + +* Tue Feb 11 2014 Bryn M. Reeves = 3.0-20 +- Prevent unhandled exception during command output substitution + Resolves: bz1030553 + +* Mon Feb 10 2014 Bryn M. Reeves = 3.0-19 +- Fix generation of volume names in gluster plugin + Resolves: bz1036752 +- Add distupgrade plugin + Resolves: bz1059760 + +* Tue Feb 04 2014 Bryn M. Reeves = 3.0-18 +- Prevent file descriptor leaks when using Popen + Resolves: bz1051009 +- Disable zip archive creation when running rhsm-debug + Resolves: bz1039036 +- Include volume geo-replication status in gluster plugin + Resolves: bz1036752 + +* Mon Feb 03 2014 Bryn M. Reeves = 3.0-17 +- Fix get_option use in cluster plugin + Resolves: bz1030553 +- Fix debug logging to file when given '-v' + Resolves: bz1031126 +- Always treat rhevm plugin's vdsmlogs option as a string + Resolves: bz1030617 +- Run the rhsm-debug script from yum plugin + Resolves: bz1039036 + +* Fri Jan 31 2014 Bryn M. Reeves = 3.0-16 +- Add new plugin to collect OpenHPI configuration + Resolves: bz1028121 +- Fix cluster plugin crm_report support + Resolves: bz1030553 +- Fix file postprocessing in ldap plugin + Resolves: bz1030602 +- Remove collection of anaconda-ks.cfg from general plugin + Resolves: bz1034865 + +* Fri Jan 24 2014 Bryn M. Reeves = 3.0-15 +- Remove debug statements from logs plugin + Resolves: bz1030042 +- Make ethernet interface detection more robust + Resolves: bz1030824 +- Fix specifying multiple plugin options on the command line + Resolves: bz1031124 +- Make log and message levels match previous versions + Resolves: bz1031126 +- Log a warning message when external commands time out + Resolves: bz1034956 +- Remove --upload command line option + Resolves: bz1028484 +- Update sos UI text to match upstream + Resolves: bz1034970 + +* Fri Dec 27 2013 Daniel Mach = 3.0-14 +- Mass rebuild 2013-12-27 + +* Thu Nov 14 2013 Bryn M. Reeves = 3.0-13 +- Fix regressions introduced with --build option + Resolves: bz1015599 + +* Tue Nov 12 2013 Bryn M. Reeves = 3.0-12 +- Fix typo in yum plug-in add_forbidden_paths + Resolves: bz829297 +- Add krb5 plug-in and drop collection of krb5.keytab + Resolves: bz1028150 + +* Fri Nov 8 2013 Bryn M. Reeves = 3.0-10 +- Add nfs client plug-in + Resolves: bz1028072 +- Fix traceback when sar module force-enabled + Resolves: bz1028125 + +* Thu Nov 7 2013 Bryn M. Reeves = 3.0-9 +- Restore --build command line option + Resolves: bz1015599 +- Collect saved vmcore-dmesg.txt files + Resolves: bz1026959 +- Normalize temporary directory paths + Resolves: bz829069 + +* Tue Nov 5 2013 Bryn M. Reeves = 3.0-7 +- Add domainname output to NIS plug-in + Resolves: bz1026906 +- Collect /var/log/squid in squid plug-in + Resolves: bz1026829 +- Collect mountstats and mountinfo in filesys plug-in + Resolves: bz1026869 +- Add PowerPC plug-in from upstream + Resolves: bz1025236 + +* Thu Oct 31 2013 Bryn M. Reeves = 3.0-6 +- Remove version checks in gluster plug-in + Resolves: bz1015606 +- Check for usable temporary directory + Resolves: bz1019517 +- Fix --alloptions command line option + Resolves: bz1019356 +- Fix configuration fail regression + Resolves: bz1019516 + +* Wed Oct 30 2013 Bryn M. Reeves = 3.0-5 +- Include /etc/yaboot.conf in boot plug-in + Resolves: bz1001966 +- Fix collection of brctl output in networking plug-in + Resolves: bz1019235 +- Verify limited set of RPM packages by default + Resolves: bz1019863 +- Do not strip newlines from command output + Resolves: bz1019338 +- Limit default sar data collection + Resolves: bz1001599 + +* Thu Oct 3 2013 Bryn M. Reeves = 3.0-4 +- Do not attempt to read RPC pseudo files in networking plug-in + Resolves: bz996992, bz996994 +- Restrict wbinfo collection to the current domain + Resolves: bz997101 +- Add obfuscation of luci secrets to cluster plug-in + Resolves: bz997090 +- Add XFS plug-in + Resolves: bz997094 +- Fix policy class handling of --tmp-dir + Resolves: bz997083 +- Do not set batch mode if stdin is not a TTY + Resolves: bz1002943 +- Attempt to continue when reading bad input in interactive mode + Resolves: bz1002943 + +* Wed Aug 14 2013 Bryn M. Reeves = 3.0-3 +- Add crm_report support to cluster plug-in + Resolves: bz839342 +- Fix rhel_version() usage in cluster and s390 plug-ins + Resolves: bz916705 +- Strip trailing newline from command output + Resolves: bz971420 + +* Mon Jun 10 2013 Bryn M. Reeves = 3.0-2 +- Silence 'could not run' messages at default verbosity +- New upstream release + +* Thu May 23 2013 Bryn M. Reeves = 2.2-39 +- Always invoke tar with '-f-' option + +* Mon Jan 21 2013 Bryn M. Reeves = 2.2-38 +- Fix interactive mode regression when --ticket unspecified + +* Fri Jan 18 2013 Bryn M. Reeves = 2.2-37 +- Fix propagation of --ticket parameter in interactive mode + +* Thu Jan 17 2013 Bryn M. Reeves = 2.2-36 +- Revert OpenStack patch + +* Wed Jan 9 2013 Bryn M. Reeves = 2.2-35 +- Report --name and --ticket values as defaults +- Fix device-mapper command execution logging +- Fix data collection and rename PostreSQL module to pgsql + +* Fri Oct 19 2012 Bryn M. Reeves = 2.2-34 +- Add support for content delivery hosts to RHUI module + +* Thu Oct 18 2012 Bryn M. Reeves = 2.2-33 +- Add Red Hat Update Infrastructure module +- Collect /proc/iomem in hardware module +- Collect subscription-manager output in general module +- Collect rhsm log files in general module +- Fix exception in gluster module on non-gluster systems +- Fix exception in psql module when dbname is not given + +* Wed Oct 17 2012 Bryn M. Reeves = 2.2-32 +- Collect /proc/pagetypeinfo in memory module +- Strip trailing newline from command output +- Add sanlock module +- Do not collect archived accounting files in psacct module +- Call spacewalk-debug from rhn module to collect satellite data + +* Mon Oct 15 2012 Bryn M. Reeves = 2.2-31 +- Avoid calling volume status when collecting gluster statedumps +- Use a default report name if --name is empty +- Quote tilde characters passed to shell in RPM module +- Collect KDC and named configuration in ipa module +- Sanitize hostname characters before using as report path +- Collect /etc/multipath in device-mapper module +- New plug-in for PostgreSQL +- Add OpenStack module +- Avoid deprecated sysctls in /proc/sys/net +- Fix error logging when calling external programs +- Use ip instead of ifconfig to generate network interface lists + +* Wed May 23 2012 Bryn M. Reeves = 2.2-29 +- Collect the swift configuration directory in gluster module +- Update IPA module and related plug-ins + +* Fri May 18 2012 Bryn M. Reeves = 2.2-28 +- Collect mcelog files in the hardware module + +* Wed May 02 2012 Bryn M. Reeves = 2.2-27 +- Add nfs statedump collection to gluster module + +* Tue May 01 2012 Bryn M. Reeves = 2.2-26 +- Use wildcard to match possible libvirt log paths + +* Mon Apr 23 2012 Bryn M. Reeves = 2.2-25 +- Add forbidden paths for new location of gluster private keys + +* Fri Mar 9 2012 Bryn M. Reeves = 2.2-24 +- Fix katello and aeolus command string syntax +- Remove stray hunk from gluster module patch + +* Thu Mar 8 2012 Bryn M. Reeves = 2.2-22 +- Correct aeolus debug invocation in CloudForms module +- Update gluster module for gluster-3.3 +- Add additional command output to gluster module +- Add support for collecting gluster configuration and logs + +* Wed Mar 7 2012 Bryn M. Reeves = 2.2-19 +- Collect additional diagnostic information for realtime systems +- Improve sanitization of RHN user and case number in report name +- Fix verbose output and debug logging +- Add basic support for CloudForms data collection +- Add support for Subscription Asset Manager diagnostics + +* Tue Mar 6 2012 Bryn M. Reeves = 2.2-18 +- Collect fence_virt.conf in cluster module +- Fix collection of /proc/net directory tree +- Gather output of cpufreq-info when present +- Fix brctl showstp output when bridges contain multiple interfaces +- Add /etc/modprobe.d to kernel module +- Ensure relative symlink targets are correctly handled when copying +- Fix satellite and proxy package detection in rhn plugin +- Collect stderr output from external commands +- Collect /proc/cgroups in the cgroups module + Resolve: bz784874 +- Collect /proc/irq in the kernel module +- Fix installed-rpms formatting for long package names +- Add symbolic links for truncated log files +- Collect non-standard syslog and rsyslog log files +- Use correct paths for tomcat6 in RHN module +- Obscure root password if present in anacond-ks.cfg +- Do not accept embedded forward slashes in RHN usernames +- Add new sunrpc module to collect rpcinfo for gluster systems + +* Tue Nov 1 2011 Bryn M. Reeves = 2.2-17 +- Do not collect subscription manager keys in general plugin + +* Fri Sep 23 2011 Bryn M. Reeves = 2.2-16 +- Fix execution of RHN hardware.py from hardware plugin +- Fix hardware plugin to support new lsusb path + +* Fri Sep 09 2011 Bryn M. Reeves = 2.2-15 +- Fix brctl collection when a bridge contains no interfaces +- Fix up2dateclient path in hardware plugin + +* Mon Aug 15 2011 Bryn M. Reeves = 2.2-14 +- Collect brctl show and showstp output +- Collect nslcd.conf in ldap plugin + +* Sun Aug 14 2011 Bryn M. Reeves = 2.2-11 +- Truncate files that exceed specified size limit +- Add support for collecting Red Hat Subscrition Manager configuration +- Collect /etc/init on systems using upstart +- Don't strip whitespace from output of external programs +- Collect ipv6 neighbour table in network module +- Collect basic cgroups configuration data + +* Sat Aug 13 2011 Bryn M. Reeves = 2.2-10 +- Fix collection of data from LVM2 reporting tools in devicemapper plugin +- Add /proc/vmmemctl collection to vmware plugin + +* Fri Aug 12 2011 Bryn M. Reeves = 2.2-9 +- Collect yum repository list by default +- Add basic Infiniband plugin +- Add plugin for scsi-target-utils iSCSI target +- Fix autofs plugin LC_ALL usage +- Fix collection of lsusb and add collection of -t and -v outputs +- Extend data collection by qpidd plugin +- Add ethtool pause, coalesce and ring (-a, -c, -g) options to network plugin + +* Thu Apr 07 2011 Bryn M. Reeves = 2.2-8 +- Use sha256 for report digest when operating in FIPS mode + +* Tue Apr 05 2011 Bryn M. Reeves = 2.2-7 +- Fix parted and dumpe2fs output on s390 + +* Fri Feb 25 2011 Bryn M. Reeves = 2.2-6 +- Fix collection of chkconfig output in startup.py +- Collect /etc/dhcp in dhcp.py plugin +- Collect dmsetup ls --tree output in devicemapper.py +- Collect lsblk output in filesys.py + +* Thu Feb 24 2011 Bryn M. Reeves = 2.2-4 +- Fix collection of logs and config files in sssd.py +- Add support for collecting entitlement certificates in rhn.py + +* Thu Feb 03 2011 Bryn M. Reeves = 2.2-3 +- Fix cluster plugin dlm lockdump for el6 +- Add sssd plugin to collect configuration and logs +- Collect /etc/anacrontab in system plugin +- Correct handling of redhat-release for el6 + +* Thu Jul 29 2010 Adam Stokes = 2.2-2 + +* Thu Jun 10 2010 Adam Stokes = 2.2-0 + +* Wed Apr 28 2010 Adam Stokes = 2.1-0 + +* Mon Apr 12 2010 Adam Stokes = 2.0-0 + +* Tue Mar 30 2010 Adam Stokes = 1.9-3 +- fix setup.py to autocompile translations and man pages +- rebase 1.9 + +* Fri Mar 19 2010 Adam Stokes = 1.9-2 +- updated translations + +* Thu Mar 04 2010 Adam Stokes = 1.9-1 +- version bump 1.9 +- replaced compression utility with xz +- strip threading/multiprocessing +- simplified progress indicator +- pylint update +- put global vars in class container +- unittests +- simple profiling +- make use of xgettext as pygettext is deprecated + +* Mon Jan 18 2010 Adam Stokes = 1.8-21 +- more sanitizing options for log files +- rhbz fixes from RHEL version merged into trunk +- progressbar update +