aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Yarwood <lyarwood@redhat.com>2015-10-06 11:48:32 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-10-15 12:29:13 +0100
commit76d6c40c8067a2d4c07f8f9eb2c7bfc9e4542b23 (patch)
treed7d6e230f355697dd99ccea342970a20cb7a6069
parent07eadbe81749a7aeb93573124c6c73a99e7a1918 (diff)
downloadsos-76d6c40c8067a2d4c07f8f9eb2c7bfc9e4542b23.tar.gz
[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 <lyarwood@redhat.com>
-rw-r--r--sos/plugins/openstack_ironic.py9
1 files changed, 8 insertions, 1 deletions
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/')