Ejemplo n.º 1
0
 def dispatch(*params):
     status = loadbalancer_plugin_api.STATUS_OK
     message = loadbalancer_plugin_api.STATUS_OK
     device = params[0]
     data = None
     try:
         driver = ServiceDriverManager.get_driver(constants.LOADBALANCER, device["type"], device["version"])
         data = getattr(driver, item)(*params)
     except Exception as e:
         LOG.error(_('Exception "%s" occurred in the driver'), e)
         status = loadbalancer_plugin_api.STATUS_ERROR
         message = str(e)
     return Dispatcher(data, device, status, message)
Ejemplo n.º 2
0
 def __init__(self, host, conf=None):
     self.conf = conf or cfg.CONF
     self.driver_manager = ServiceDriverManager.get_instance()
     super(ServiceAgent, self).__init__(host=host)