From 76d6c40c8067a2d4c07f8f9eb2c7bfc9e4542b23 Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Tue, 6 Oct 2015 11:48:32 +0100 Subject: [openstack_ironic] Limit log collection to .log files by default Also introduce the global all_logs and log_size options within the plugin. Allowing users to control when all logs are collected and limit the overall size of the logs collected. Signed-off-by: Lee Yarwood --- sos/plugins/openstack_ironic.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sos/plugins/openstack_ironic.py b/sos/plugins/openstack_ironic.py index 735745e0..50ed02ed 100644 --- a/sos/plugins/openstack_ironic.py +++ b/sos/plugins/openstack_ironic.py @@ -26,7 +26,14 @@ class OpenStackIronic(Plugin): def setup(self): self.conf_list = ['/etc/ironic/*'] self.add_copy_spec('/etc/ironic/') - self.add_copy_spec('/var/log/ironic/') + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): + self.add_copy_spec_limit("/var/log/ironic/", + sizelimit=self.limit) + else: + self.add_copy_spec_limit("/var/log/ironic/*.log", + sizelimit=self.limit) self.add_cmd_output('ls -laRt /var/lib/ironic/') -- cgit