aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-07-10 09:27:22 +0000
committershnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-07-10 09:27:22 +0000
commitc0fa22c1b56507aae456665d19f4bd2155413d63 (patch)
tree0e3fab3516f3ba7768271e9add8e5ab19c5be052
parent86a98753ea78d477a4974c3a459aa782a4d64c2f (diff)
downloadsos-c0fa22c1b56507aae456665d19f4bd2155413d63.tar.gz
* plugin.defaultenabled() decides whether a plugin will be automatically loaded or only if specified in -o.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@183 ef72aa8b-4018-0410-8976-d6e080ef94d8
-rw-r--r--src/lib/sos/plugintools.py5
-rwxr-xr-xsrc/sosreport5
2 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/sos/plugintools.py b/src/lib/sos/plugintools.py
index 8c51fcfc..0196bd55 100644
--- a/src/lib/sos/plugintools.py
+++ b/src/lib/sos/plugintools.py
@@ -420,6 +420,11 @@ class PluginBase:
it should run or not.
"""
return True
+
+ def defaultenabled(self):
+ """This devices whether a plugin should be automatically loaded or
+ only if manually specified in the command line."""
+ return True
def collect(self):
""" This function has been replaced with setup(). Please change your
diff --git a/src/sosreport b/src/sosreport
index aa4e193e..10cab38a 100755
--- a/src/sosreport
+++ b/src/sosreport
@@ -394,8 +394,11 @@ def sosreport():
else:
soslog.warning("Plugin %s does not validate, skipping" % plug)
continue
+ if not __cmdLineOpts__.onlyplugins and not pluginClass(plugbase, commons).defaultenabled():
+ soslog.log(logging.VERBOSE, "Plugin %s not loaded by default." % plug)
+ continue
if not pluginClass(plugbase, commons).checkenabled():
- soslog.log(logging.VERBOSE, "Plugin %s auto-disabled itself." % plug)
+ soslog.log(logging.VERBOSE, "Plugin %s is inactive." % plug)
continue
loadedplugins.append((plugbase, pluginClass(plugbase, commons)))
except: