From 2fd8cf971094cf6d266c4a93cb7047f030b2539a Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Tue, 6 Oct 2015 11:32:45 +0100 Subject: [openstack_keystone] 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. Resolves #445 Signed-off-by: Lee Yarwood --- sos/plugins/openstack_keystone.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sos/plugins/openstack_keystone.py b/sos/plugins/openstack_keystone.py index f40bdf44..eff060b6 100644 --- a/sos/plugins/openstack_keystone.py +++ b/sos/plugins/openstack_keystone.py @@ -23,8 +23,7 @@ class OpenStackKeystone(Plugin): plugin_name = "openstack_keystone" profiles = ('openstack', 'openstack_controller') - option_list = [("log", "gathers openstack keystone logs", "slow", True), - ("nopw", "dont gathers keystone passwords", "slow", True)] + option_list = [("nopw", "dont gathers keystone passwords", "slow", True)] def setup(self): self.add_copy_spec([ @@ -34,8 +33,13 @@ class OpenStackKeystone(Plugin): "/etc/keystone/policy.json" ]) - if self.get_option("log"): - self.add_copy_spec("/var/log/keystone/") + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): + self.add_copy_spec_limit("/var/log/keystone/", + sizelimit=self.limit) + else: + self.add_copy_spec_limit("/var/log/keystone/*.log", + sizelimit=self.limit) def postproc(self): protect_keys = [ -- cgit