aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Yarwood <lyarwood@redhat.com>2015-10-06 11:37:35 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-10-15 12:29:13 +0100
commitfbdcf7d7b45efd30698a2eab685095de6b724297 (patch)
treeac8aef616420a28be3d9df053d07c9bd991a41b3
parent6c29eb0c758827212a9f144cf68d6bde90fac277 (diff)
downloadsos-fbdcf7d7b45efd30698a2eab685095de6b724297.tar.gz
[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 <lyarwood@redhat.com>
-rw-r--r--sos/plugins/openstack_trove.py14
1 files 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):