aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2019-03-22 18:09:02 +0000
committerBryn M. Reeves <bmr@redhat.com>2019-03-22 18:31:09 +0000
commit7272805a3104e1feb7878fcc9b12e79b7a5edd5f (patch)
tree73158f0ab0471e5bc7bfcf6db0fa12278466e5c6
parent2edc54905686bdb9b16c93083b8f1fe2dc3229ce (diff)
downloadsos-7272805a3104e1feb7878fcc9b12e79b7a5edd5f.tar.gz
[Plugin] always use current predicate in log messages
The 'pred' local in collection methods is unused when a default (command or plugin) predicate is in use. Always retrieve the active predicate via get_predicate() when logging predicate decisions. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/plugins/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index 8791419c..8f1e4e40 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -749,7 +749,7 @@ class Plugin(object):
"""
if not self.test_predicate(pred=pred):
self._log_info("skipped copy spec '%s' due to predicate (%s)" %
- (copyspecs, pred))
+ (copyspecs, self.get_predicate(pred=pred)))
return
if sizelimit is None:
@@ -884,7 +884,7 @@ class Plugin(object):
self._log_info("added cmd output '%s'" % cmd)
else:
self._log_info("skipped cmd output '%s' due to predicate (%s)" %
- (cmd, pred))
+ (cmd, self.get_predicate(cmd=True, pred=pred)))
def add_cmd_output(self, cmds, suggest_filename=None,
root_symlink=None, timeout=300, stderr=True,
@@ -956,7 +956,7 @@ class Plugin(object):
if not self.test_predicate(cmd=False, pred=pred):
self._log_info("skipped string ...'%s' due to predicate (%s)" %
- (summary, pred))
+ (summary, self.get_predicate(pred=pred)))
return
self.copy_strings.append((content, filename))
@@ -973,7 +973,7 @@ class Plugin(object):
if not self.test_predicate(cmd=True, pred=pred):
self._log_info("skipped cmd output '%s' due to predicate (%s)" %
- (exe, pred))
+ (exe, self.get_predicate(cmd=True, pred=pred)))
return None
result = self.get_command_output(exe, timeout=timeout, stderr=stderr,