X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmanagers%2Fmanagerwrapper.py;h=946f7d2b9762fe64d71c3d0989eddd78af02ab51;hb=3e9276552b2368c8a660d0db61e533944cae6688;hp=b0326d67d0cce0af059c6f56aaad275dac9c97c4;hpb=68f0f5bf538b2633fceee633be2748aaa3eaa709;p=sfa.git diff --git a/sfa/managers/managerwrapper.py b/sfa/managers/managerwrapper.py index b0326d67..946f7d2b 100644 --- a/sfa/managers/managerwrapper.py +++ b/sfa/managers/managerwrapper.py @@ -15,20 +15,23 @@ class ManagerWrapper: is not implemented by a libarary and will generally be more helpful than the standard AttributeError """ - def __init__(self, manager, interface): + def __init__(self, manager, interface, config): if isinstance (manager, ModuleType): # old-fashioned module implementation self.manager = manager elif isinstance (manager, ClassType): # create an instance; we don't pass the api in argument as it is passed # to the actual method calls anyway - self.manager = manager() + self.manager = manager(config) else: + # that's what happens when there's something wrong with the db + # or any bad stuff of that kind at startup time + logger.log_exc("Failed to create a manager, startup sequence is broken") raise SfaAPIError,"Argument to ManagerWrapper must be a module or class" self.interface = interface def __getattr__(self, method): if not hasattr(self.manager, method): - raise SfaNotImplemented(method, self.interface) + raise SfaNotImplemented(self.interface, method) return getattr(self.manager, method)