diff options
-rw-r--r-- | sos/plugins/__init__.py | 11 | ||||
-rw-r--r-- | tests/plugin_tests.py | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index b1c225db..2920030f 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -539,6 +539,7 @@ class Plugin(object): a single file the file will be tailed to meet sizelimit. If the first file in a glob is too large it will be tailed to meet the sizelimit. """ + sizelimit = sizelimit or self.get_option("log_size") if self.get_option('all_logs'): sizelimit = None @@ -672,6 +673,7 @@ class Plugin(object): cmds = [cmds] if len(cmds) > 1 and (suggest_filename or root_symlink): self._log_warn("ambiguous filename or symlink for command list") + sizelimit = sizelimit or self.get_option("log_size") for cmd in cmds: self._add_cmd_output(cmd, suggest_filename=suggest_filename, root_symlink=root_symlink, timeout=timeout, @@ -831,6 +833,15 @@ class Plugin(object): identifier_opt = " --identifier %s" catalog_opt = " --catalog" + journal_size = 100 + + sizelimit = sizelimit or self.get_option("log_size") + if not sizelimit or int(sizelimit) < journal_size: + sizelimit = journal_size + + if self.get_option('all_logs'): + sizelimit = None + if isinstance(units, six.string_types): units = [units] diff --git a/tests/plugin_tests.py b/tests/plugin_tests.py index 60d59d6f..c03e313e 100644 --- a/tests/plugin_tests.py +++ b/tests/plugin_tests.py @@ -92,6 +92,7 @@ class EnablerPlugin(Plugin): class MockOptions(object): all_logs = False + log_size = 25 class PluginToolTests(unittest.TestCase): |