diff options
author | Lee Yarwood <lyarwood@redhat.com> | 2015-09-26 13:56:22 +0100 |
---|---|---|
committer | Adam Stokes <adam.stokes@ubuntu.com> | 2015-09-30 13:46:37 -0400 |
commit | bb7996737902db5d25751ebbca8d293ace3bac01 (patch) | |
tree | e8c2980f46cb11eff466a52798848f1b067a0800 | |
parent | 4fe61508971a7d2a058ce17942994d3425bdf591 (diff) | |
download | sos-bb7996737902db5d25751ebbca8d293ace3bac01.tar.gz |
[openstack_nova] 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 #447
Closes #647
Signed-off-by: Lee Yarwood <lyarwood@redhat.com>
Signed-off-by: Adam Stokes <adam.stokes@ubuntu.com>
-rw-r--r-- | sos/plugins/openstack_nova.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sos/plugins/openstack_nova.py b/sos/plugins/openstack_nova.py index 43fceaa5..4097c996 100644 --- a/sos/plugins/openstack_nova.py +++ b/sos/plugins/openstack_nova.py @@ -26,8 +26,7 @@ class OpenStackNova(Plugin): plugin_name = "openstack_nova" profiles = ('openstack', 'openstack_controller', 'openstack_compute') - option_list = [("log", "gathers openstack nova logs", "slow", True), - ("cmds", "gathers openstack nova commands", "slow", False)] + option_list = [("cmds", "gathers openstack nova commands", "slow", False)] def setup(self): if self.get_option("cmds"): @@ -56,8 +55,13 @@ class OpenStackNova(Plugin): "nova-manage vm list", suggest_filename="nova_vm_list") - if self.get_option("log"): - self.add_copy_spec("/var/log/nova/") + self.limit = self.get_option("log_size") + if self.get_option("all_logs"): + self.add_copy_spec_limit("/var/log/nova/", + sizelimit=self.limit) + else: + self.add_copy_spec_limit("/var/log/nova/*.log", + sizelimit=self.limit) self.add_copy_spec("/etc/nova/") |