aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2021-10-04 14:43:08 +0200
committerJake Hunsaker <jhunsake@redhat.com>2021-10-06 17:01:53 -0400
commite56b3ea999731b831ebba80cf367e43e65c12b62 (patch)
treef9ba6a97d9ed4e78f5bf67af4995cda779643856
parent7a88558e2e5d6dd002cbf1f304a875f3d034b8a9 (diff)
downloadsos-e56b3ea999731b831ebba80cf367e43e65c12b62.tar.gz
[report] Overwrite pred=None before refering predicate attributes
During a dry run, add_journal method sets pred=None whilst log_skipped_cmd refers to predicate attributes. In that case, replace None predicate by a default / empty predicate. Resolves: #2711 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/report/plugins/__init__.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py
index 3c2b64d9..c635b8de 100644
--- a/sos/report/plugins/__init__.py
+++ b/sos/report/plugins/__init__.py
@@ -1693,6 +1693,8 @@ class Plugin():
def _add_cmd_output(self, **kwargs):
"""Internal helper to add a single command to the collection list."""
pred = kwargs.pop('pred') if 'pred' in kwargs else SoSPredicate(self)
+ if pred is None:
+ pred = SoSPredicate(self)
if 'priority' not in kwargs:
kwargs['priority'] = 10
if 'changes' not in kwargs: