Blame SOURCES/sos-bz1851923-powerpc-missing-logs.patch

2518e3
From 1368498e8d5c5e2d9cd93c335252efe8e08316a4 Mon Sep 17 00:00:00 2001
2518e3
From: Jake Hunsaker <jhunsake@redhat.com>
2518e3
Date: Thu, 30 Apr 2020 14:05:21 -0400
2518e3
Subject: [PATCH] [Plugin] Fix enablement triggers when only restriction is
2518e3
 architecture
2518e3
2518e3
When a plugin, such as the `powerpc` plugin, only defines an
2518e3
architecture enablement trigger and no files, commands, packages, etc...
2518e3
our current enablement checks would return false. When the 'normal'
2518e3
trigger restrictions are all empty, but there is an architecture
2518e3
trigger, now properly enable based solely on that architecture.
2518e3
2518e3
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
2518e3
---
2518e3
 sos/plugins/__init__.py | 5 +++++
2518e3
 1 file changed, 5 insertions(+)
2518e3
2518e3
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
2518e3
index 011113b0..c632d5e4 100644
2518e3
--- a/sos/plugins/__init__.py
2518e3
+++ b/sos/plugins/__init__.py
2518e3
@@ -1775,6 +1775,11 @@ class Plugin(object):
2518e3
         return True
2518e3
 
2518e3
     def _check_plugin_triggers(self, files, packages, commands, services):
2518e3
+
2518e3
+        if not any([files, packages, commands, services]):
2518e3
+            # no checks beyond architecture restrictions
2518e3
+            return self.check_is_architecture()
2518e3
+
2518e3
         return ((any(os.path.exists(fname) for fname in files) or
2518e3
                 any(self.is_installed(pkg) for pkg in packages) or
2518e3
                 any(is_executable(cmd) for cmd in commands) or
2518e3
-- 
2518e3
2.26.2
2518e3