Blame SOURCES/sos-bz1938874-potential-issues-static-analyse.patch

47940b
From 6d5cbe90e17534d53d7fe42dff4d8ca734acf594 Mon Sep 17 00:00:00 2001
47940b
From: Jake Hunsaker <jhunsake@redhat.com>
47940b
Date: Tue, 29 Jun 2021 15:49:00 -0400
47940b
Subject: [PATCH] [yum] Fix potential traceback when yum history is empty
47940b
47940b
Like we did in #969 for `dnf`, fix a potential issue where we would
47940b
generate a traceback in the plugin when `yum history` is empty.
47940b
47940b
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
47940b
---
47940b
 sos/report/plugins/yum.py | 2 +-
47940b
 1 file changed, 1 insertion(+), 1 deletion(-)
47940b
47940b
diff --git a/sos/report/plugins/yum.py b/sos/report/plugins/yum.py
47940b
index 54e222df..aec805e6 100644
47940b
--- a/sos/report/plugins/yum.py
47940b
+++ b/sos/report/plugins/yum.py
47940b
@@ -91,7 +91,7 @@ class Yum(Plugin, RedHatPlugin):
47940b
         # packages installed/erased/updated per transaction
47940b
         if self.get_option("yum-history-info"):
47940b
             history = self.exec_cmd("yum history")
47940b
-            transactions = None
47940b
+            transactions = -1
47940b
             if history['status'] == 0:
47940b
                 for line in history['output'].splitlines():
47940b
                     try:
47940b
-- 
47940b
2.31.1
47940b
47940b
From a7a4ef73faee6cddba36bf670d4a20ab0521c36f Mon Sep 17 00:00:00 2001
47940b
From: Pavel Moravec <pmoravec@redhat.com>
47940b
Date: Wed, 30 Jun 2021 13:10:56 +0200
47940b
Subject: [PATCH] [plugins] Set default predicate instead of None for
47940b
 robustness
47940b
47940b
Just making the code more robustness, it could be dangerous to
47940b
set pred = None and then potentially call log_skipped_cmd that
47940b
expects "pred" of SoSPredicate type.
47940b
47940b
Currently such a call flow can not happen, but it is worth to
47940b
make the code more robust for potential future changes.
47940b
47940b
Resolves: #2601
47940b
47940b
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
47940b
---
47940b
 sos/report/plugins/__init__.py | 2 +-
47940b
 1 file changed, 1 insertion(+), 1 deletion(-)
47940b
47940b
diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py
47940b
index 6fd1a3b2..b9cd28ed 100644
47940b
--- a/sos/report/plugins/__init__.py
47940b
+++ b/sos/report/plugins/__init__.py
47940b
@@ -1629,7 +1629,7 @@ class Plugin(object):
47940b
 
47940b
     def _add_cmd_output(self, **kwargs):
47940b
         """Internal helper to add a single command to the collection list."""
47940b
-        pred = kwargs.pop('pred') if 'pred' in kwargs else None
47940b
+        pred = kwargs.pop('pred') if 'pred' in kwargs else SoSPredicate(self)
47940b
         soscmd = SoSCommand(**kwargs)
47940b
         self._log_debug("packed command: " + soscmd.__str__())
47940b
         for _skip_cmd in self.skip_commands:
47940b
-- 
47940b
2.31.1
47940b