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