aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Yarwood <lyarwood@redhat.com>2015-10-06 11:30:52 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-10-15 12:29:13 +0100
commite4b236480296794042935e577126633195b90f4f (patch)
tree4d834244260e93f4765e6aac32f8aaa17d5c963a
parentd1b18ef42a009538f9de9bd363495cbbdce63675 (diff)
downloadsos-e4b236480296794042935e577126633195b90f4f.tar.gz
[openstack_horizon] 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 #444 Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
-rw-r--r--sos/plugins/openstack_horizon.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/sos/plugins/openstack_horizon.py b/sos/plugins/openstack_horizon.py
index 7ad424b5..b6e32c8f 100644
--- a/sos/plugins/openstack_horizon.py
+++ b/sos/plugins/openstack_horizon.py
@@ -26,12 +26,19 @@ class OpenStackHorizon(Plugin):
plugin_name = "openstack_horizon"
profiles = ('openstack', 'openstack_controller')
- option_list = [("log", "gathers openstack horizon logs", "slow", True)]
+ option_list = []
def setup(self):
+
+ self.limit = self.get_option("log_size")
+ if self.get_option("all_logs"):
+ self.add_copy_spec_limit("/var/log/horizon/",
+ sizelimit=self.limit)
+ else:
+ self.add_copy_spec_limit("/var/log/horizon/*.log",
+ sizelimit=self.limit)
+
self.add_copy_spec("/etc/openstack-dashboard/")
- if self.get_option("log"):
- self.add_copy_spec("/var/log/horizon/")
def postproc(self):
protect_keys = [