- message="Generic.make_manager for interface=%s and flavour=%s"%(interface,flavour)
-
- classname = "%s_class"%interface
+ message = "Generic.make_manager for interface=%s and flavour=%s" % (
+ interface, flavour)
+
+ classname = "%s_manager_class" % interface
+ try:
+ module_or_class = getattr(self, classname)()
+ logger.debug("%s : %s" % (message, module_or_class))
+ # this gets passed to ManagerWrapper that will
+ # call the class constructor if it's a class,
+ # or use the module as is if it's a module
+ # so bottom line is, don't try the constructor here
+ return module_or_class
+ except Exception:
+ logger.log_exc(message)
+ exit(1)
+
+ # need interface to select the right driver
+ def make_driver(self, api):
+ config = api.config
+ interface = api.interface
+ flavour = self.flavour
+ message = "Generic.make_driver for flavour=%s and interface=%s" % (
+ flavour, interface)
+
+ if interface == "component":
+ classname = "component_driver_class"
+ else:
+ classname = "driver_class"