aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Yarwood <lyarwood@redhat.com>2015-10-06 11:35:32 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-10-15 12:29:13 +0100
commit6c29eb0c758827212a9f144cf68d6bde90fac277 (patch)
tree65c60672093acab6fb8fdce8f6ee23c105b387fc
parent2fd8cf971094cf6d266c4a93cb7047f030b2539a (diff)
downloadsos-6c29eb0c758827212a9f144cf68d6bde90fac277.tar.gz
[openstack_neutron] 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 #446 Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
-rw-r--r--sos/plugins/openstack_neutron.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/sos/plugins/openstack_neutron.py b/sos/plugins/openstack_neutron.py
index 72b83880..05576905 100644
--- a/sos/plugins/openstack_neutron.py
+++ b/sos/plugins/openstack_neutron.py
@@ -33,8 +33,7 @@ class OpenStackNeutron(Plugin):
plugin_name = "openstack_neutron"
profiles = ('openstack', 'openstack_controller', 'openstack_compute')
- option_list = [("log", "Gathers all Neutron logs", "slow", False),
- ("quantum", "Overrides checks for newer Neutron components",
+ option_list = [("quantum", "Overrides checks for newer Neutron components",
"fast", False)]
component_name = "neutron"
@@ -43,10 +42,15 @@ class OpenStackNeutron(Plugin):
if not os.path.exists("/etc/neutron/") or self.get_option("quantum"):
self.component_name = "quantum"
- self.add_copy_spec([
- "/etc/%s/" % self.component_name,
- "/var/log/%s/" % self.component_name
- ])
+ self.limit = self.get_option("log_size")
+ if self.get_option("all_logs"):
+ self.add_copy_spec_limit("/var/log/%s/" % self.component_name,
+ sizelimit=self.limit)
+ else:
+ self.add_copy_spec_limit("/var/log/%s/*.log" % self.component_name,
+ sizelimit=self.limit)
+
+ self.add_copy_spec("/etc/%s/" % self.component_name)
self.netns_dumps()