def set_up_db_rpcclient(): topic = constants_v2.TOPIC_PROCESS_ON_HOST_V2 if conf.environment_specific_plugin: topic = topic + '_' + conf.environment_prefix driver_rpc = plugin_rpc.LBaaSv2PluginRPC(topic, context, conf.environment_prefix, conf.environment_group_number, agent_host) return driver_rpc
def _setup_rpc(self): # LBaaS Plugin API topic = constants_v2.TOPIC_PROCESS_ON_HOST_V2 if self.conf.environment_specific_plugin: topic = topic + '_' + self.conf.environment_prefix LOG.debug('agent in %s environment will send callbacks to %s' % (self.conf.environment_prefix, topic)) self.plugin_rpc = plugin_rpc.LBaaSv2PluginRPC( topic, self.context, self.conf.environment_prefix, self.conf.environment_group_number, self.agent_host) # Allow driver to make callbacks using the # same RPC proxy as the manager self.lbdriver.set_plugin_rpc(self.plugin_rpc) self._setup_state_rpc(topic) # Setup message queues to listen for updates from # Neutron. if not self.conf.f5_global_routed_mode: # Core plugin self.lbdriver.set_tunnel_rpc(agent_rpc.PluginApi(topics.PLUGIN)) consumers = [[constants_v2.TUNNEL, topics.UPDATE]] if self.conf.l2_population: # L2 Populate plugin Callbacks API self.lbdriver.set_l2pop_rpc( l2pop_rpc.L2populationAgentNotifyAPI()) consumers.append( [topics.L2POPULATION, topics.UPDATE, self.agent_host]) self.endpoints = [self] self.connection = agent_rpc.create_consumers( self.endpoints, topics.AGENT, consumers)
def mocked_target(init): init.return_value = None return target_mod.LBaaSv2PluginRPC()
def create_target(cls, payload, m_target, m_get_client): m_target.return_value = m_target m_get_client.return_value = m_get_client return target_mod.LBaaSv2PluginRPC(*payload)
def fully_mocked_plugin_rpc(init): init.return_value = None return plugin_rpc.LBaaSv2PluginRPC()
"""Agent manager to handle plugin to agent RPC and periodic tasks."""