def make_driver (self, config, 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" try: class_obj = getattr(self,classname)() logger.debug("%s : %s"%(message,class_obj)) return class_obj(config) except: logger.log_exc_critical(message)
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" try: class_obj = getattr(self, classname)() logger.debug("%s : %s" % (message, class_obj)) return class_obj(api) except: logger.log_exc_critical(message)
def make_manager (self, interface): """ interface expected in ['registry', 'aggregate', 'slicemgr', 'component'] flavour is e.g. 'pl' or 'max' or whatever """ flavour = self.flavour 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: logger.log_exc_critical(message)
def make_manager(self, interface): """ interface expected in ['registry', 'aggregate', 'slicemgr', 'component'] flavour is e.g. 'pl' or 'max' or whatever """ flavour = self.flavour 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: logger.log_exc_critical(message)
r = Registry("", config.SFA_REGISTRY_PORT, server_key_file, server_cert_file) r.start() if options.am: from sfa.server.aggregate import Aggregate a = Aggregate("", config.SFA_AGGREGATE_PORT, server_key_file, server_cert_file) a.start() # start slice manager if options.sm: from sfa.server.slicemgr import SliceMgr s = SliceMgr("", config.SFA_SM_PORT, server_key_file, server_cert_file) s.start() if options.cm: from sfa.server.component import Component c = Component("", config.component_port, server_key_file, server_cert_file) # c = Component("", config.SFA_COMPONENT_PORT, server_key_file, server_cert_file) c.start() if __name__ == "__main__": try: main() except: logger.log_exc_critical("SFA server is exiting")
from sfa.server.registry import Registry r = Registry("", config.SFA_REGISTRY_PORT, server_key_file, server_cert_file) r.start() if (options.am): from sfa.server.aggregate import Aggregate a = Aggregate("", config.SFA_AGGREGATE_PORT, server_key_file, server_cert_file) a.start() # start slice manager if (options.sm): from sfa.server.slicemgr import SliceMgr s = SliceMgr("", config.SFA_SM_PORT, server_key_file, server_cert_file) s.start() if (options.cm): from sfa.server.component import Component c = Component("", config.component_port, server_key_file, server_cert_file) # c = Component("", config.SFA_COMPONENT_PORT, server_key_file, server_cert_file) c.start() if __name__ == "__main__": try: main() except: logger.log_exc_critical("SFA server is exiting")