From fbdcf7d7b45efd30698a2eab685095de6b724297 Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Tue, 6 Oct 2015 11:37:35 +0100 Subject: [openstack_trove] 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_trove.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sos/plugins/openstack_trove.py b/sos/plugins/openstack_trove.py index f924505c..549397bc 100644 --- a/sos/plugins/openstack_trove.py +++ b/sos/plugins/openstack_trove.py @@ -24,13 +24,19 @@ class OpenStackTrove(Plugin): plugin_name = "openstack_trove" profiles = ('openstack', 'openstack_controller') - option_list = [("log", "gathers openstack trove logs", "slow", True)] + option_list = [] def setup(self): - self.add_copy_spec('/etc/trove/') - if self.get_option('log'): - self.add_copy_spec('/var/log/trove') + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): + self.add_copy_spec_limit("/var/log/trove/", + sizelimit=self.limit) + else: + self.add_copy_spec_limit("/var/log/trove/*.log", + sizelimit=self.limit) + + self.add_copy_spec('/etc/trove/') def postproc(self): -- cgit