コード例 #1
0
 def _setup_rpc(self):
     # RPC support
     self.service_topics = {
         svc_constants.CORE: topics.PLUGIN,
         svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN
     }
     self.rpc_context = oslo_context.RequestContext('neutron',
                                                    'neutron',
                                                    is_admin=False)
     self.conn = n_rpc.create_connection(new=True)
     self.endpoints = [
         BridgeRpcCallbacks(),
         securitygroups_rpc.SecurityGroupServerRpcCallback(),
         dhcp_rpc.DhcpRpcCallback(),
         l3_rpc.L3RpcCallback(),
         agents_db.AgentExtRpcCallback(),
         metadata_rpc.MetadataRpcCallback()
     ]
     for svc_topic in self.service_topics.values():
         self.conn.create_consumer(svc_topic, self.endpoints, fanout=False)
     # Consume from all consumers in threads
     self.conn.consume_in_threads()
     self.notifier = AgentNotifierApi(topics.AGENT)
     self.agent_notifiers[q_const.AGENT_TYPE_DHCP] = (
         dhcp_rpc_agent_api.DhcpAgentNotifyAPI())
     self.agent_notifiers[q_const.AGENT_TYPE_L3] = (
         l3_rpc_agent_api.L3AgentNotifyAPI())
コード例 #2
0
ファイル: l3_odl.py プロジェクト: trozet/networking-odl
 def setup_rpc(self):
     self.topic = topics.L3PLUGIN
     self.conn = n_rpc.create_connection(new=True)
     self.agent_notifiers.update(
         {q_const.AGENT_TYPE_L3: l3_rpc_agent_api.L3AgentNotifyAPI()})
     self.endpoints = [l3_rpc.L3RpcCallback()]
     self.conn.create_consumer(self.topic, self.endpoints, fanout=False)
     self.conn.consume_in_threads()
コード例 #3
0
 def start_rpc_listeners(self):
     self.topic = topics.L3PLUGIN
     self.conn = n_rpc.Connection()
     self.agent_notifiers.update(
         {const.AGENT_TYPE_L3: l3_rpc_agent_api.L3AgentNotifyAPI()})
     self.endpoints = [l3_rpc.L3RpcCallback()]
     self.conn.create_consumer(self.topic, self.endpoints, fanout=False)
     return self.conn.consume_in_threads()
コード例 #4
0
 def setup_rpc(self):
     # RPC support
     self.topic = topics.L3PLUGIN
     self.conn = n_rpc.create_connection(new=True)
     self.agent_notifiers.update(
         {l3_constants.AGENT_TYPE_L3: l3_rpc_agent_api.L3AgentNotifyAPI()})
     self.endpoints = [_VyattaL3RPCEndpoint()]
     self.conn.create_consumer(self.topic, self.endpoints, fanout=False)
     self.conn.consume_in_threads()
コード例 #5
0
    def _start_rpc_notifiers(self):
        """Initialize RPC notifiers for agents."""

        if cfg.CONF.df.use_centralized_ipv6_DHCP:
            self.agent_notifiers[const.AGENT_TYPE_DHCP] = (
                dhcp_rpc_agent_api.DhcpAgentNotifyAPI())

        self.agent_notifiers[const.AGENT_TYPE_L3] = (
            l3_rpc_agent_api.L3AgentNotifyAPI())
コード例 #6
0
 def setup_rpc(self):
     # RPC support
     self.topic = topics.L3PLUGIN
     self.conn = n_rpc.create_connection()
     self.agent_notifiers[bc.constants.AGENT_TYPE_L3] = (
         l3_rpc_agent_api.L3AgentNotifyAPI())
     self.agent_notifiers[cisco_constants.AGENT_TYPE_L3_CFG] = (
         l3_router_rpc_cfg_agent_api.L3RouterCfgAgentNotifyAPI(self))
     self.endpoints = [l3_rpc.L3RpcCallback(),
                       l3cfg_rpc.L3RouterCfgRpcCallback(self)]
     self.conn.create_consumer(self.topic, self.endpoints,
                               fanout=False)
     # Consume from all consumers in threads
     self.conn.consume_in_threads()
コード例 #7
0
    def __init__(self):
        self.router_scheduler = importutils.import_object(
            cfg.CONF.router_scheduler_driver)
        self.add_periodic_l3_agent_status_check()
        super(L3RouterPlugin, self).__init__()
        if 'dvr' in self.supported_extension_aliases:
            l3_dvrscheduler_db.subscribe()
        self.agent_notifiers.update(
            {n_const.AGENT_TYPE_L3: l3_rpc_agent_api.L3AgentNotifyAPI()})

        rpc_worker = service.RpcWorker([self], worker_process_count=0)

        self.add_worker(rpc_worker)
        self.l3_driver_controller = driver_controller.DriverController(self)
コード例 #8
0
 def setup_rpc(self):
     # RPC support
     self.service_topics = {svc_constants.CORE: topics.PLUGIN,
                            svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN}
     self.conn = n_rpc.create_connection(new=True)
     self.notifier = AgentNotifierApi(topics.AGENT)
     self.agent_notifiers[q_const.AGENT_TYPE_DHCP] = (
         dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
     )
     self.agent_notifiers[q_const.AGENT_TYPE_L3] = (
         l3_rpc_agent_api.L3AgentNotifyAPI()
     )
     self.endpoints = [OVSRpcCallbacks(self.notifier, self.tunnel_type),
                       agents_db.AgentExtRpcCallback()]
     for svc_topic in self.service_topics.values():
         self.conn.create_consumer(svc_topic, self.endpoints, fanout=False)
     # Consume from all consumers in threads
     self.conn.consume_in_threads()
コード例 #9
0
 def _setup_rpc(self):
     self.conn = n_rpc.create_connection(new=True)
     self.endpoints = [
         dhcp_rpc.DhcpRpcCallback(),
         l3_rpc.L3RpcCallback(),
         agents_db.AgentExtRpcCallback(),
         metadata_rpc.MetadataRpcCallback()
     ]
     self.agent_notifiers[const.AGENT_TYPE_L3] = (
         l3_rpc_agent_api.L3AgentNotifyAPI())
     self.agent_notifiers[const.AGENT_TYPE_DHCP] = (
         dhcp_rpc_agent_api.DhcpAgentNotifyAPI())
     self.network_scheduler = importutils.import_object(
         cfg.CONF.network_scheduler_driver)
     self.supported_extension_aliases.extend(
         ['agent', 'dhcp_agent_scheduler'])
     self.conn.create_consumer(topics.PLUGIN, self.endpoints, fanout=False)
     self.conn.create_consumer(topics.L3PLUGIN,
                               self.endpoints,
                               fanout=False)
     self.conn.consume_in_threads()
コード例 #10
0
 def _start_rpc_notifiers(self):
     """Initialization RPC notifiers for agents"""
     self.agent_notifiers[const.AGENT_TYPE_L3] = {
         l3_rpc_agent_api.L3AgentNotifyAPI()
     }
コード例 #11
0
ファイル: l3_db.py プロジェクト: bobmel/neutron
 def l3_rpc_notifier(self):
     if not hasattr(self, '_l3_rpc_notifier'):
         self._l3_rpc_notifier = l3_rpc_agent_api.L3AgentNotifyAPI()
     return self._l3_rpc_notifier
コード例 #12
0
 def setUp(self):
     super(TestL3AgentNotifyAPI, self).setUp()
     self.rpc_client_mock = mock.patch.object(
         rpc, 'get_client').start().return_value
     self.l3_notifier = l3_rpc_agent_api.L3AgentNotifyAPI()
コード例 #13
0
 def setUp(self):
     super(TestL3AgentNotifyAPI, self).setUp()
     self.rpc_client_mock = mock.patch(
         'neutron.common.rpc.get_client').start().return_value
     self.l3_notifier = l3_rpc_agent_api.L3AgentNotifyAPI()