X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fmanagers%2Fmanagerwrapper.py;h=da8c98f689fc4096601e175a03ddedc390abf6eb;hb=ecc85e0b923922cf7117d29b380f5284edb88f21;hp=86907e790968785fa60d234093a178aacd2dbb70;hpb=845abc0f39d56c0f1120f0a1226de5321076d10a;p=sfa.git diff --git a/sfa/managers/managerwrapper.py b/sfa/managers/managerwrapper.py index 86907e79..da8c98f6 100644 --- a/sfa/managers/managerwrapper.py +++ b/sfa/managers/managerwrapper.py @@ -15,16 +15,19 @@ 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: - raise SfaAPIError,"Argument to ManagerWrapper must be a module or class" + # 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):