aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Tantsur <divius.inside@gmail.com>2017-10-26 12:25:08 +0000
committerBryn M. Reeves <bmr@redhat.com>2018-03-09 15:11:00 +0000
commit6a23a57596e94ea3e4f4f19513c8b691af9c53ff (patch)
tree4d722f4c328cc7fe94a7d9b75dacd812b91e0d67
parentbecab7d603b86975c8712d73c738bbf621740b01 (diff)
downloadsos-6a23a57596e94ea3e4f4f19513c8b691af9c53ff.tar.gz
[openstack_ironic] collect introspection data for all nodes
Signed-off-by: Dmitry Tantsur <divius.inside@gmail.com>
-rw-r--r--sos/plugins/openstack_ironic.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/sos/plugins/openstack_ironic.py b/sos/plugins/openstack_ironic.py
index 51118634..ddb094e0 100644
--- a/sos/plugins/openstack_ironic.py
+++ b/sos/plugins/openstack_ironic.py
@@ -125,6 +125,20 @@ class RedHatIronic(OpenStackIronic, RedHatPlugin):
'openstack-ironic-discoverd-ramdisk'
]
+ def collect_introspection_data(self):
+ uuids_result = self.call_ext_prog('openstack baremetal node list '
+ '-f value -c UUID')
+ if uuids_result['status']:
+ self.soslog.warning('Failed to fetch list of ironic node UUIDs, '
+ 'introspection data won\'t be collected')
+ return
+
+ uuids = [uuid for uuid in uuids_result['output'].split()
+ if uuid.strip()]
+ for uuid in uuids:
+ self.add_cmd_output('openstack baremetal introspection '
+ 'data save %s' % uuid)
+
def setup(self):
super(RedHatIronic, self).setup()
@@ -157,5 +171,7 @@ class RedHatIronic(OpenStackIronic, RedHatPlugin):
if self.osc_available:
self.add_cmd_output("openstack baremetal introspection list")
+ if self.get_option("all_logs"):
+ self.collect_introspection_data()
# vim: set et ts=4 sw=4 :