summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Lint/__init__.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2014-01-07 15:43:04 -0500
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2014-01-07 15:43:04 -0500
commitf5444c339c1223e4dd51a7d0448dfe9655069168 (patch)
tree2d9e0bded30603f684ef906e0e230c5217281099 /src/lib/Bcfg2/Server/Lint/__init__.py
parent7497f20a4821515fc9c8dadf85d3c4f3b47245eb (diff)
downloadbcfg2-f5444c339c1223e4dd51a7d0448dfe9655069168.tar.gz
bcfg2-f5444c339c1223e4dd51a7d0448dfe9655069168.tar.bz2
bcfg2-f5444c339c1223e4dd51a7d0448dfe9655069168.zip
bcfg2-lint: fixed automatically loading server plugin lint plugins
Diffstat (limited to 'src/lib/Bcfg2/Server/Lint/__init__.py')
-rw-r--r--src/lib/Bcfg2/Server/Lint/__init__.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/__init__.py b/src/lib/Bcfg2/Server/Lint/__init__.py
index 8a793fd94..9b3e6ece2 100644
--- a/src/lib/Bcfg2/Server/Lint/__init__.py
+++ b/src/lib/Bcfg2/Server/Lint/__init__.py
@@ -13,6 +13,7 @@ import lxml.etree
import Bcfg2.Options
import Bcfg2.Server.Core
import Bcfg2.Server.Plugins
+from Bcfg2.Compat import walk_packages
def _ioctl_GWINSZ(fd): # pylint: disable=C0103
@@ -297,11 +298,10 @@ class LintPluginAction(Bcfg2.Options.ComponentAction):
bases = ['Bcfg2.Server.Lint']
def __call__(self, parser, namespace, values, option_string=None):
- for plugin in getattr(Bcfg2.Options.setup, "plugins", []):
- module = sys.modules[plugin.__module__]
- if hasattr(module, "%sLint" % plugin.name):
- print("Adding lint plugin %s" % plugin)
- values.append(plugin)
+ plugins = getattr(Bcfg2.Options.setup, "plugins", [])
+ for lint_plugin in walk_packages(path=__path__):
+ if lint_plugin[1] in plugins:
+ values.append(lint_plugin[1])
Bcfg2.Options.ComponentAction.__call__(self, parser, namespace, values,
option_string)