diff options
author | Lee Yarwood <lyarwood@redhat.com> | 2015-10-06 11:22:28 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2015-10-15 12:29:13 +0100 |
commit | b3306011519a25636a1f7ddb5632e01f926d035b (patch) | |
tree | ff62d71f7805046721b0146120a449ddff535771 | |
parent | 18fa0dfa139ec2504ad0b0d83c12c3ae45c07d71 (diff) | |
download | sos-b3306011519a25636a1f7ddb5632e01f926d035b.tar.gz |
[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 <lyarwood@redhat.com>
-rw-r--r-- | sos/plugins/openstack_cinder.py | 12 |
1 files 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 = [ |