1
0
forked from rpms/sos
sos/sos-bz2012858-dryrun-uncaught-exception.patch
Pavel Moravec 7163d4a466 sos updates to RHEL 9.0 GA
Resolves: bz2011507 bz2011536 bz2011537 bz2012858 bz2019697

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
2021-11-03 11:39:42 +01:00

34 lines
1.1 KiB
Diff

From e56b3ea999731b831ebba80cf367e43e65c12b62 Mon Sep 17 00:00:00 2001
From: Pavel Moravec <pmoravec@redhat.com>
Date: Mon, 4 Oct 2021 14:43:08 +0200
Subject: [PATCH] [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>
---
sos/report/plugins/__init__.py | 2 ++
1 file changed, 2 insertions(+)
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:
--
2.31.1