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

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