Skip to content
Browse files

Lint: Import lint plugins with package name

When importing packages we should not pollute the global modules
namespace and always import new modules with their package name.
  • Loading branch information...
AlexanderS committed May 7, 2019
1 parent 0770075 commit ad2b80f4d2b940f7b4a15c94e6324b35fe0a762e
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/lib/Bcfg2/Server/Lint/
@@ -327,7 +327,10 @@ def early_parsing_hook(self, namespace):
plugins = [p.__name__ for p in namespace.plugins]
for loader, name, _is_pkg in walk_packages(path=__path__):
module = loader.find_module(name).load_module(name)
module_name = 'Bcfg2.Server.Lint.%s' % name
module = loader \
.find_module(module_name) \
plugin = getattr(module, name)
if plugin.__serverplugin__ is None or \
plugin.__serverplugin__ in plugins:

0 comments on commit ad2b80f

Please sign in to comment.
You can’t perform that action at this time.