Blame SOURCES/sos-bz2012858-dryrun-uncaught-exception.patch

92cd8f
From e56b3ea999731b831ebba80cf367e43e65c12b62 Mon Sep 17 00:00:00 2001
92cd8f
From: Pavel Moravec <pmoravec@redhat.com>
92cd8f
Date: Mon, 4 Oct 2021 14:43:08 +0200
92cd8f
Subject: [PATCH] [report] Overwrite pred=None before refering predicate
92cd8f
 attributes
92cd8f
92cd8f
During a dry run, add_journal method sets pred=None whilst log_skipped_cmd
92cd8f
refers to predicate attributes. In that case, replace None predicate
92cd8f
by a default / empty predicate.
92cd8f
92cd8f
Resolves: #2711
92cd8f
92cd8f
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
92cd8f
---
92cd8f
 sos/report/plugins/__init__.py | 2 ++
92cd8f
 1 file changed, 2 insertions(+)
92cd8f
92cd8f
diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py
92cd8f
index 3c2b64d9..c635b8de 100644
92cd8f
--- a/sos/report/plugins/__init__.py
92cd8f
+++ b/sos/report/plugins/__init__.py
92cd8f
@@ -1693,6 +1693,8 @@ class Plugin():
92cd8f
     def _add_cmd_output(self, **kwargs):
92cd8f
         """Internal helper to add a single command to the collection list."""
92cd8f
         pred = kwargs.pop('pred') if 'pred' in kwargs else SoSPredicate(self)
92cd8f
+        if pred is None:
92cd8f
+            pred = SoSPredicate(self)
92cd8f
         if 'priority' not in kwargs:
92cd8f
             kwargs['priority'] = 10
92cd8f
         if 'changes' not in kwargs:
92cd8f
-- 
92cd8f
2.31.1
92cd8f