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

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