diff options
author | Lee Yarwood <lyarwood@redhat.com> | 2015-10-06 11:28:55 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2015-10-15 12:29:13 +0100 |
commit | d1b18ef42a009538f9de9bd363495cbbdce63675 (patch) | |
tree | ad89dcf4634693a95da96605b7938d95a3b0e543 | |
parent | a34bf1defc1066cd028d1bc6a7a60c11cbfad996 (diff) | |
download | sos-d1b18ef42a009538f9de9bd363495cbbdce63675.tar.gz |
[openstack_heat] 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 #443
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
-rw-r--r-- | sos/plugins/openstack_heat.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sos/plugins/openstack_heat.py b/sos/plugins/openstack_heat.py index 2886a736..a85d4f78 100644 --- a/sos/plugins/openstack_heat.py +++ b/sos/plugins/openstack_heat.py @@ -23,7 +23,7 @@ class OpenStackHeat(Plugin): plugin_name = "openstack_heat" profiles = ('openstack', 'openstack_controller') - option_list = [("log", "gathers openstack-heat logs", "slow", False)] + option_list = [] def setup(self): # Heat @@ -31,10 +31,16 @@ class OpenStackHeat(Plugin): "heat-manage db_version", suggest_filename="heat_db_version" ) - self.add_copy_spec([ - "/etc/heat/", - "/var/log/heat/" - ]) + + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): + self.add_copy_spec_limit("/var/log/heat/", + sizelimit=self.limit) + else: + self.add_copy_spec_limit("/var/log/heat/*.log", + sizelimit=self.limit) + + self.add_copy_spec("/etc/heat/") def postproc(self): protect_keys = [ |