Blame SOURCES/sos-bz1517767-osp-ironic.patch

7b9b39
From 24dc645e5f09af921bd74bf2808ef8c99dd4cfb9 Mon Sep 17 00:00:00 2001
7b9b39
From: Dmitry Tantsur <divius.inside@gmail.com>
7b9b39
Date: Thu, 26 Oct 2017 11:59:26 +0000
7b9b39
Subject: [PATCH 1/4] [openstack_ironic] collect drivers, ports and port groups
7b9b39
7b9b39
Existing collection of ports is extended with the --long option.
7b9b39
7b9b39
Signed-off-by: Dmitry Tantsur <divius.inside@gmail.com>
7b9b39
---
7b9b39
 sos/plugins/openstack_ironic.py | 4 +++-
7b9b39
 1 file changed, 3 insertions(+), 1 deletion(-)
7b9b39
7b9b39
diff --git a/sos/plugins/openstack_ironic.py b/sos/plugins/openstack_ironic.py
7b9b39
index f4e0a97d3..b25bf81b2 100644
7b9b39
--- a/sos/plugins/openstack_ironic.py
7b9b39
+++ b/sos/plugins/openstack_ironic.py
7b9b39
@@ -82,8 +82,10 @@ def setup(self):
7b9b39
                                 "the environment file for the user intended "
7b9b39
                                 "to connect to the OpenStack environment.")
7b9b39
         else:
7b9b39
+            self.add_cmd_output("openstack baremetal driver list --long")
7b9b39
             self.add_cmd_output("openstack baremetal node list --long")
7b9b39
-            self.add_cmd_output("openstack baremetal port list")
7b9b39
+            self.add_cmd_output("openstack baremetal port list --long")
7b9b39
+            self.add_cmd_output("openstack baremetal port group list --long")
7b9b39
 
7b9b39
     def postproc(self):
7b9b39
         protect_keys = [
7b9b39
7b9b39
From a03031587a3470a92f3c4002c7e645b18867ff61 Mon Sep 17 00:00:00 2001
7b9b39
From: Dmitry Tantsur <divius.inside@gmail.com>
7b9b39
Date: Thu, 26 Oct 2017 12:01:46 +0000
7b9b39
Subject: [PATCH 2/4] [openstack_ironic] collect information about
7b9b39
 ironic-inspector
7b9b39
7b9b39
ironic-discoverd was renamed to ironic-inspector in the Liberty
7b9b39
release. This change adds support for the new name.
7b9b39
7b9b39
Signed-off-by: Dmitry Tantsur <divius.inside@gmail.com>
7b9b39
---
7b9b39
 sos/plugins/openstack_ironic.py | 24 +++++++++++++++++++++++-
7b9b39
 1 file changed, 23 insertions(+), 1 deletion(-)
7b9b39
7b9b39
diff --git a/sos/plugins/openstack_ironic.py b/sos/plugins/openstack_ironic.py
7b9b39
index b25bf81b2..123d4b7cc 100644
7b9b39
--- a/sos/plugins/openstack_ironic.py
7b9b39
+++ b/sos/plugins/openstack_ironic.py
7b9b39
@@ -77,7 +77,9 @@ def setup(self):
7b9b39
         vars_any = [p in os.environ for p in [
7b9b39
                     'OS_TENANT_NAME', 'OS_PROJECT_NAME']]
7b9b39
 
7b9b39
-        if not (all(vars_all) and any(vars_any)):
7b9b39
+        self.osc_available = all(vars_all) and any(vars_any)
7b9b39
+
7b9b39
+        if not self.osc_available:
7b9b39
             self.soslog.warning("Not all environment variables set. Source "
7b9b39
                                 "the environment file for the user intended "
7b9b39
                                 "to connect to the OpenStack environment.")
7b9b39
@@ -137,4 +139,24 @@ def setup(self):
7b9b39
             self.add_journal(units="openstack-ironic-discoverd")
7b9b39
             self.add_journal(units="openstack-ironic-discoverd-dnsmasq")
7b9b39
 
7b9b39
+        # ironic-discoverd was renamed to ironic-inspector in Liberty
7b9b39
+        self.conf_list.append('/etc/ironic-inspector/*')
7b9b39
+        self.conf_list.append(self.var_puppet_gen + '/etc/ironic-inspector/*')
7b9b39
+        self.add_copy_spec('/etc/ironic-inspector/')
7b9b39
+        self.add_copy_spec(self.var_puppet_gen + '/etc/ironic-inspector/')
7b9b39
+        self.add_copy_spec('/var/lib/ironic-inspector/')
7b9b39
+        if self.get_option("all_logs"):
7b9b39
+            self.add_copy_spec('/var/log/ironic-inspector/')
7b9b39
+            self.add_copy_spec('/var/log/containers/ironic-inspector/')
7b9b39
+        else:
7b9b39
+            self.add_copy_spec('/var/log/ironic-inspector/*.log')
7b9b39
+            self.add_copy_spec('/var/log/ironic-inspector/ramdisk/')
7b9b39
+            self.add_copy_spec('/var/log/containers/ironic-inspector/*.log')
7b9b39
+            self.add_copy_spec('/var/log/containers/ironic-inspector/ramdisk/')
7b9b39
+
7b9b39
+        self.add_journal(units="openstack-ironic-inspector-dnsmasq")
7b9b39
+
7b9b39
+        if self.osc_available:
7b9b39
+            self.add_cmd_output("openstack baremetal introspection list")
7b9b39
+
7b9b39
 # vim: set et ts=4 sw=4 :
7b9b39
7b9b39
From 9c91e28aa7356b96a198606a74d1b39d7ec66891 Mon Sep 17 00:00:00 2001
7b9b39
From: Dmitry Tantsur <divius.inside@gmail.com>
7b9b39
Date: Thu, 26 Oct 2017 12:12:25 +0000
7b9b39
Subject: [PATCH 3/4] [openstack_ironic] collect PXE environment information
7b9b39
7b9b39
This adds two directories, /httpboot and /tftpboot, as well as version
7b9b39
of iPXE boot images package.
7b9b39
7b9b39
Signed-off-by: Dmitry Tantsur <divius.inside@gmail.com>
7b9b39
---
7b9b39
 sos/plugins/openstack_ironic.py | 7 +++----
7b9b39
 1 file changed, 3 insertions(+), 4 deletions(-)
7b9b39
7b9b39
diff --git a/sos/plugins/openstack_ironic.py b/sos/plugins/openstack_ironic.py
7b9b39
index 123d4b7cc..51118634b 100644
7b9b39
--- a/sos/plugins/openstack_ironic.py
7b9b39
+++ b/sos/plugins/openstack_ironic.py
7b9b39
@@ -63,10 +63,9 @@ def setup(self):
7b9b39
                 "/var/log/containers/httpd/ironic-api/*log"
7b9b39
             ], sizelimit=self.limit)
7b9b39
 
7b9b39
-        self.add_cmd_output('ls -laRt /var/lib/ironic/')
7b9b39
-        self.add_cmd_output(
7b9b39
-            'ls -laRt ' + self.var_puppet_gen + '/var/lib/ironic/'
7b9b39
-        )
7b9b39
+        for path in ['/var/lib/ironic', '/httpboot', '/tftpboot']:
7b9b39
+            self.add_cmd_output('ls -laRt %s' % path)
7b9b39
+            self.add_cmd_output('ls -laRt %s' % (self.var_puppet_gen + path))
7b9b39
 
7b9b39
         if self.get_option("verify"):
7b9b39
             self.add_cmd_output("rpm -V %s" % ' '.join(self.packages))
7b9b39
7b9b39
From c33d82592b7145c6a26a47280b750eea41eeb63e Mon Sep 17 00:00:00 2001
7b9b39
From: Dmitry Tantsur <divius.inside@gmail.com>
7b9b39
Date: Thu, 26 Oct 2017 12:25:08 +0000
7b9b39
Subject: [PATCH 4/4] [openstack_ironic] collect introspection data for all
7b9b39
 nodes
7b9b39
7b9b39
Signed-off-by: Dmitry Tantsur <divius.inside@gmail.com>
7b9b39
---
7b9b39
 sos/plugins/openstack_ironic.py | 16 ++++++++++++++++
7b9b39
 1 file changed, 16 insertions(+)
7b9b39
7b9b39
diff --git a/sos/plugins/openstack_ironic.py b/sos/plugins/openstack_ironic.py
7b9b39
index 51118634b..ddb094e01 100644
7b9b39
--- a/sos/plugins/openstack_ironic.py
7b9b39
+++ b/sos/plugins/openstack_ironic.py
7b9b39
@@ -125,6 +125,20 @@ class RedHatIronic(OpenStackIronic, RedHatPlugin):
7b9b39
         'openstack-ironic-discoverd-ramdisk'
7b9b39
     ]
7b9b39
 
7b9b39
+    def collect_introspection_data(self):
7b9b39
+        uuids_result = self.call_ext_prog('openstack baremetal node list '
7b9b39
+                                          '-f value -c UUID')
7b9b39
+        if uuids_result['status']:
7b9b39
+            self.soslog.warning('Failed to fetch list of ironic node UUIDs, '
7b9b39
+                                'introspection data won\'t be collected')
7b9b39
+            return
7b9b39
+
7b9b39
+        uuids = [uuid for uuid in uuids_result['output'].split()
7b9b39
+                 if uuid.strip()]
7b9b39
+        for uuid in uuids:
7b9b39
+            self.add_cmd_output('openstack baremetal introspection '
7b9b39
+                                'data save %s' % uuid)
7b9b39
+
7b9b39
     def setup(self):
7b9b39
         super(RedHatIronic, self).setup()
7b9b39
 
7b9b39
@@ -157,5 +171,7 @@ def setup(self):
7b9b39
 
7b9b39
         if self.osc_available:
7b9b39
             self.add_cmd_output("openstack baremetal introspection list")
7b9b39
+            if self.get_option("all_logs"):
7b9b39
+                self.collect_introspection_data()
7b9b39
 
7b9b39
 # vim: set et ts=4 sw=4 :