Blame SOURCES/sos-bz1874295-osp-ironic-inspector-configs.patch

900d18
From 4e46e0c8db3e2ecea7279ae7a781ae2e22a81b69 Mon Sep 17 00:00:00 2001
900d18
From: David Vallee Delisle <dvd@redhat.com>
900d18
Date: Mon, 31 Aug 2020 18:58:42 -0400
900d18
Subject: [PATCH] [openstack_ironic] Missing ironic-inspector configs
900d18
900d18
We're missing the ironic-inspector configurations, probably because they
900d18
were in the RedHatPlugin class, at the bottom of the file and they were
900d18
probably missed when updating this plugin. Moving them at the top with
900d18
the other `add_copy_spec` will help tracking them in case something
900d18
change again.
900d18
900d18
Revamping also the way we grab logs to check if we're in a container
900d18
first.
900d18
900d18
Resolves: #2223
900d18
900d18
Signed-off-by: David Vallee Delisle <dvd@redhat.com>
900d18
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
900d18
---
900d18
 sos/report/plugins/openstack_ironic.py | 121 +++++++++++++++++--------
900d18
 1 file changed, 82 insertions(+), 39 deletions(-)
900d18
900d18
diff --git a/sos/report/plugins/openstack_ironic.py b/sos/report/plugins/openstack_ironic.py
900d18
index 314d2a58..57060a27 100644
900d18
--- a/sos/report/plugins/openstack_ironic.py
900d18
+++ b/sos/report/plugins/openstack_ironic.py
900d18
@@ -20,41 +20,95 @@ class OpenStackIronic(Plugin):
900d18
     profiles = ('openstack', 'openstack_undercloud')
900d18
 
900d18
     var_puppet_gen = "/var/lib/config-data/puppet-generated/ironic"
900d18
+    ins_puppet_gen = var_puppet_gen + "_inspector"
900d18
 
900d18
     def setup(self):
900d18
-        self.conf_list = [
900d18
-            "/etc/ironic/*",
900d18
-            self.var_puppet_gen + "/etc/ironic/*",
900d18
-            self.var_puppet_gen + "_api/etc/ironic/*"
900d18
-        ]
900d18
-        self.add_copy_spec([
900d18
-            "/etc/ironic/",
900d18
-            self.var_puppet_gen + "/etc/xinetd.conf",
900d18
-            self.var_puppet_gen + "/etc/xinetd.d/",
900d18
-            self.var_puppet_gen + "/etc/ironic/",
900d18
-            self.var_puppet_gen + "/etc/httpd/conf/",
900d18
-            self.var_puppet_gen + "/etc/httpd/conf.d/",
900d18
-            self.var_puppet_gen + "/etc/httpd/conf.modules.d/*.conf",
900d18
-            self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf",
900d18
-            self.var_puppet_gen + "_api/etc/ironic/",
900d18
-            self.var_puppet_gen + "_api/etc/httpd/conf/",
900d18
-            self.var_puppet_gen + "_api/etc/httpd/conf.d/",
900d18
-            self.var_puppet_gen + "_api/etc/httpd/conf.modules.d/*.conf",
900d18
-            self.var_puppet_gen + "_api/etc/my.cnf.d/tripleo.cnf"
900d18
-        ])
900d18
-
900d18
-        if self.get_option("all_logs"):
900d18
+
900d18
+        in_container = self.container_exists('.*ironic_api')
900d18
+
900d18
+        if in_container:
900d18
+            self.conf_list = [
900d18
+                self.var_puppet_gen + "/etc/ironic/*",
900d18
+                self.var_puppet_gen + "/etc/ironic-inspector/*",
900d18
+                self.var_puppet_gen + "_api/etc/ironic/*",
900d18
+                self.ins_puppet_gen + "/etc/ironic-inspector/*",
900d18
+                self.ins_puppet_gen + "/var/lib/httpboot/inspector.ipxe"
900d18
+            ]
900d18
             self.add_copy_spec([
900d18
-                "/var/log/ironic/",
900d18
+                "/var/lib/ironic-inspector/",
900d18
+                "/var/log/containers/ironic-inspector/ramdisk/",
900d18
+                self.var_puppet_gen + "/etc/xinetd.conf",
900d18
+                self.var_puppet_gen + "/etc/xinetd.d/",
900d18
+                self.var_puppet_gen + "/etc/ironic/",
900d18
+                self.var_puppet_gen + "/etc/ironic-inspector/",
900d18
+                self.var_puppet_gen + "/etc/httpd/conf/",
900d18
+                self.var_puppet_gen + "/etc/httpd/conf.d/",
900d18
+                self.var_puppet_gen + "/etc/httpd/conf.modules.d/*.conf",
900d18
+                self.var_puppet_gen + "/etc/my.cnf.d/tripleo.cnf",
900d18
+                self.var_puppet_gen + "_api/etc/ironic/",
900d18
+                self.var_puppet_gen + "_api/etc/httpd/conf/",
900d18
+                self.var_puppet_gen + "_api/etc/httpd/conf.d/",
900d18
+                self.var_puppet_gen + "_api/etc/httpd/conf.modules.d/*.conf",
900d18
+                self.var_puppet_gen + "_api/etc/my.cnf.d/tripleo.cnf",
900d18
+                self.ins_puppet_gen + "/etc/ironic-inspector/*",
900d18
+                self.ins_puppet_gen + "/var/lib/httpboot/inspector.ipxe"
900d18
             ])
900d18
+
900d18
+            if self.get_option("all_logs"):
900d18
+                self.add_copy_spec([
900d18
+                    "/var/log/containers/ironic/",
900d18
+                    "/var/log/containers/ironic-inspector/"
900d18
+                ])
900d18
+            else:
900d18
+                self.add_copy_spec([
900d18
+                    "/var/log/containers/ironic/*.log",
900d18
+                    "/var/log/containers/ironic-inspector/*.log",
900d18
+                ])
900d18
+
900d18
+            for path in ['/var/lib/ironic', '/httpboot', '/tftpboot',
900d18
+                         self.ins_puppet_gen + '/var/lib/httpboot/',
900d18
+                         self.ins_puppet_gen + '/var/lib/tftpboot/']:
900d18
+                self.add_cmd_output('ls -laRt %s' % path)
900d18
+                self.add_cmd_output('ls -laRt %s' %
900d18
+                                    (self.var_puppet_gen + path))
900d18
+
900d18
+            # Let's get the packages from the containers, always helpful when
900d18
+            # troubleshooting.
900d18
+            for container_name in ['ironic_inspector_dnsmasq',
900d18
+                                   'ironic_inspector', 'ironic_pxe_http',
900d18
+                                   'ironic_pxe_tftp', 'ironic_neutron_agent',
900d18
+                                   'ironic_conductor', 'ironic_api']:
900d18
+                if self.container_exists('.*' + container_name):
900d18
+                    self.add_cmd_output(self.fmt_container_cmd(container_name,
900d18
+                                                               'rpm -qa'))
900d18
+
900d18
         else:
900d18
+            self.conf_list = [
900d18
+                "/etc/ironic/*",
900d18
+                "/etc/ironic-inspector/*",
900d18
+            ]
900d18
             self.add_copy_spec([
900d18
-                "/var/log/ironic/*.log",
900d18
+                "/etc/ironic/",
900d18
+                "/etc/ironic-inspector/",
900d18
+                "/var/lib/ironic-inspector/",
900d18
+                "/var/log/ironic-inspector/ramdisk/",
900d18
+                "/etc/my.cnf.d/tripleo.cnf",
900d18
+                "/var/lib/httpboot/inspector.ipxe"
900d18
             ])
900d18
 
900d18
-        for path in ['/var/lib/ironic', '/httpboot', '/tftpboot']:
900d18
-            self.add_cmd_output('ls -laRt %s' % path)
900d18
-            self.add_cmd_output('ls -laRt %s' % (self.var_puppet_gen + path))
900d18
+            if self.get_option("all_logs"):
900d18
+                self.add_copy_spec([
900d18
+                    "/var/log/ironic/",
900d18
+                    "/var/log/ironic-inspector/",
900d18
+                ])
900d18
+            else:
900d18
+                self.add_copy_spec([
900d18
+                    "/var/log/ironic/*.log",
900d18
+                    "/var/log/ironic-inspector/*.log",
900d18
+                ])
900d18
+
900d18
+            for path in ['/var/lib/ironic', '/httpboot', '/tftpboot']:
900d18
+                self.add_cmd_output('ls -laRt %s' % path)
900d18
 
900d18
         vars_all = [p in os.environ for p in [
900d18
                     'OS_USERNAME', 'OS_PASSWORD']]
900d18
@@ -136,6 +190,7 @@ class RedHatIronic(OpenStackIronic, RedHatPlugin):
900d18
     def setup(self):
900d18
         super(RedHatIronic, self).setup()
900d18
 
900d18
+        # ironic-discoverd was renamed to ironic-inspector in Liberty
900d18
         # is the optional ironic-discoverd service installed?
900d18
         if any([self.is_installed(p) for p in self.discoverd_packages]):
900d18
             self.conf_list.append('/etc/ironic-discoverd/*')
900d18
@@ -146,18 +201,6 @@ class RedHatIronic(OpenStackIronic, RedHatPlugin):
900d18
             self.add_journal(units="openstack-ironic-discoverd")
900d18
             self.add_journal(units="openstack-ironic-discoverd-dnsmasq")
900d18
 
900d18
-        # ironic-discoverd was renamed to ironic-inspector in Liberty
900d18
-        self.conf_list.append('/etc/ironic-inspector/*')
900d18
-        self.conf_list.append(self.var_puppet_gen + '/etc/ironic-inspector/*')
900d18
-        self.add_copy_spec('/etc/ironic-inspector/')
900d18
-        self.add_copy_spec(self.var_puppet_gen + '/etc/ironic-inspector/')
900d18
-        self.add_copy_spec('/var/lib/ironic-inspector/')
900d18
-        if self.get_option("all_logs"):
900d18
-            self.add_copy_spec('/var/log/ironic-inspector/')
900d18
-        else:
900d18
-            self.add_copy_spec('/var/log/ironic-inspector/*.log')
900d18
-            self.add_copy_spec('/var/log/ironic-inspector/ramdisk/')
900d18
-
900d18
         self.add_journal(units="openstack-ironic-inspector-dnsmasq")
900d18
 
900d18
         if self.osc_available:
900d18
-- 
900d18
2.26.2
900d18