aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Yarwood <lyarwood@redhat.com>2015-10-06 11:24:46 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-10-15 12:29:13 +0100
commita34bf1defc1066cd028d1bc6a7a60c11cbfad996 (patch)
tree22f8e57f841158b79ce3e4ddd140652aa8986d0a
parentb3306011519a25636a1f7ddb5632e01f926d035b (diff)
downloadsos-a34bf1defc1066cd028d1bc6a7a60c11cbfad996.tar.gz
[openstack_glance] 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 #442 Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
-rw-r--r--sos/plugins/openstack_glance.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/sos/plugins/openstack_glance.py b/sos/plugins/openstack_glance.py
index a6e11f8e..ed6186a8 100644
--- a/sos/plugins/openstack_glance.py
+++ b/sos/plugins/openstack_glance.py
@@ -25,7 +25,7 @@ class OpenStackGlance(Plugin):
plugin_name = "openstack_glance"
profiles = ('openstack', 'openstack_controller')
- option_list = [("log", "gathers openstack-glance logs", "slow", False)]
+ option_list = []
def setup(self):
# Glance
@@ -33,10 +33,16 @@ class OpenStackGlance(Plugin):
"glance-manage db_version",
suggest_filename="glance_db_version"
)
- self.add_copy_spec([
- "/etc/glance/",
- "/var/log/glance/"
- ])
+
+ self.limit = self.get_option("log_size")
+ if self.get_option("all_logs"):
+ self.add_copy_spec_limit("/var/log/glance/",
+ sizelimit=self.limit)
+ else:
+ self.add_copy_spec_limit("/var/log/glance/*.log",
+ sizelimit=self.limit)
+
+ self.add_copy_spec("/etc/glance/")
def postproc(self):
protect_keys = [