aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/sos/plugintools.py6
-rwxr-xr-xsrc/sosreport3
2 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/sos/plugintools.py b/src/lib/sos/plugintools.py
index 3e7e9881..b5741e27 100644
--- a/src/lib/sos/plugintools.py
+++ b/src/lib/sos/plugintools.py
@@ -380,6 +380,12 @@ class PluginBase:
raise KeyboardInterrupt
except:
self.cInfo['soslog'].error("Error collecting output of '%s'" % prog,)
+
+ def checkenabled(self):
+ """ This function can be overidden to let the plugin decide whether
+ it should run or not.
+ """
+ return True
def collect(self):
""" This function has been replaced with setup(). Please change your
diff --git a/src/sosreport b/src/sosreport
index 894537b8..3adbbb8e 100755
--- a/src/sosreport
+++ b/src/sosreport
@@ -303,6 +303,9 @@ def sosreport():
else:
soslog.warning("Plugin %s does not validate, skipping" % plug)
continue
+ if pluginClass(plugbase, commons).checkenabled:
+ soslog.debug("Plugin %s auto-disabled itself." % plug)
+ continue
loadedplugins.append((plugbase, pluginClass(plugbase, commons)))
except:
soslog.warning("Plugin %s does not install, skipping" % plug)