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
commit6752cce877a70d9e2a393db92f363d5acc66e665 (patch)
treead07ec358be9969c0e2794f84b070c9a14092368
parent827d979bdf6f62e82e9796eb7b868728f280a1fb (diff)
downloadsos-6752cce877a70d9e2a393db92f363d5acc66e665.tar.gz
[openstack_swift] 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 #448 Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
-rw-r--r--sos/plugins/openstack_swift.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/sos/plugins/openstack_swift.py b/sos/plugins/openstack_swift.py
index 0f04533e..3d38a42b 100644
--- a/sos/plugins/openstack_swift.py
+++ b/sos/plugins/openstack_swift.py
@@ -25,11 +25,17 @@ class OpenStackSwift(Plugin):
plugin_name = "openstack_swift"
profiles = ('openstack', 'openstack_controller')
- option_list = [("log", "gathers openstack-swift logs", "slow", False)]
+ option_list = []
def setup(self):
- if self.get_option("log"):
- self.add_copy_spec("/var/log/swift/")
+
+ self.limit = self.get_option("log_size")
+ if self.get_option("all_logs"):
+ self.add_copy_spec_limit("/var/log/swift/",
+ sizelimit=self.limit)
+ else:
+ self.add_copy_spec_limit("/var/log/swift/*.log",
+ sizelimit=self.limit)
self.add_copy_spec("/etc/swift/")