aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Yarwood <lyarwood@redhat.com>2015-10-06 11:32:45 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-10-15 12:29:13 +0100
commit2fd8cf971094cf6d266c4a93cb7047f030b2539a (patch)
tree2c8a83cdba171d7db6a857f9dc4509850e6bb5d4
parente4b236480296794042935e577126633195b90f4f (diff)
downloadsos-2fd8cf971094cf6d266c4a93cb7047f030b2539a.tar.gz
[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 <lyarwood@redhat.com>
-rw-r--r--sos/plugins/openstack_keystone.py12
1 files 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 = [