summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Bcfg2/Server/Core.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py
index 4465abb9a..49b5628a1 100644
--- a/src/lib/Bcfg2/Server/Core.py
+++ b/src/lib/Bcfg2/Server/Core.py
@@ -209,11 +209,15 @@ class BaseCore(object):
(plugin)).Server.Plugins, plugin)
except ImportError:
try:
- mod = __import__(plugin)
+ mod = __import__(plugin, globals(), locals(), [plugin.split('.')[-1]])
except:
self.logger.error("Failed to load plugin %s" % plugin)
return
- plug = getattr(mod, plugin)
+ try:
+ plug = getattr(mod, plugin.split('.')[-1])
+ except AttributeError:
+ self.logger.error("Failed to load plugin %s (AttributeError)" % plugin)
+ return
# Blacklist conflicting plugins
cplugs = [conflict for conflict in plug.conflicts
if conflict in self.plugins]