From b3306011519a25636a1f7ddb5632e01f926d035b Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Tue, 6 Oct 2015 11:22:28 +0100 Subject: [openstack_cinder] 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 #441 Signed-off-by: Lee Yarwood --- sos/plugins/openstack_cinder.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sos/plugins/openstack_cinder.py b/sos/plugins/openstack_cinder.py index 66cd1ed0..7eb4ddbc 100644 --- a/sos/plugins/openstack_cinder.py +++ b/sos/plugins/openstack_cinder.py @@ -27,8 +27,7 @@ class OpenStackCinder(Plugin): plugin_name = "openstack_cinder" profiles = ('openstack', 'openstack_controller') - option_list = [("log", "gathers openstack cinder logs", "slow", True), - ("db", "gathers openstack cinder db version", "slow", + option_list = [("db", "gathers openstack cinder db version", "slow", False)] def setup(self): @@ -39,8 +38,13 @@ class OpenStackCinder(Plugin): self.add_copy_spec(["/etc/cinder/"]) - if self.get_option("log"): - self.add_copy_spec(["/var/log/cinder/"]) + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): + self.add_copy_spec_limit("/var/log/cinder/", + sizelimit=self.limit) + else: + self.add_copy_spec_limit("/var/log/cinder/*.log", + sizelimit=self.limit) def postproc(self): protect_keys = [ -- cgit