Ejemplo n.º 1
0
    def setup_rpc(self):
        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 = NECPluginV2AgentNotifierApi(topics.AGENT)
        self.agent_notifiers[const.AGENT_TYPE_DHCP] = (
            dhcp_rpc_agent_api.DhcpAgentNotifyAPI())
        self.agent_notifiers[const.AGENT_TYPE_L3] = (
            nec_router.L3AgentNotifyAPI())

        # NOTE: callback_sg is referred to from the sg unit test.
        self.callback_sg = securitygroups_rpc.SecurityGroupServerRpcCallback()
        self.endpoints = [
            NECPluginV2RPCCallbacks(self.safe_reference),
            dhcp_rpc.DhcpRpcCallback(),
            l3_rpc.L3RpcCallback(), self.callback_sg,
            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()
Ejemplo n.º 2
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())
Ejemplo n.º 3
0
 def start_rpc_listeners(self):
     self.endpoints = [rpc.RpcCallbacks(),
                       securitygroups_rpc.SecurityGroupServerRpcCallback(),
                       dvr_rpc.DVRServerRpcCallback(),
                       dhcp_rpc.DhcpRpcCallback(),
                       agents_db.AgentExtRpcCallback()]
     self.topic = topics.PLUGIN
     self.conn = n_rpc.create_connection(new=True)
     self.conn.create_consumer(self.topic, self.endpoints,
                               fanout=False)
     return self.conn.consume_in_threads()
Ejemplo n.º 4
0
 def _setup_rpc(self):
     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.endpoints = [RyuRpcCallbacks(self.ofp_api_host),
                       securitygroups_rpc.SecurityGroupServerRpcCallback(),
                       dhcp_rpc.DhcpRpcCallback(),
                       l3_rpc.L3RpcCallback()]
     for svc_topic in self.service_topics.values():
         self.conn.create_consumer(svc_topic, self.endpoints, fanout=False)
     self.conn.consume_in_threads()
Ejemplo n.º 5
0
 def _setup_rpc(self):
     self.conn = n_rpc.create_connection(new=True)
     self.topic = topics.PLUGIN
     self.notifier = AgentNotifierApi(topics.AGENT)
     # init dhcp agent support
     self._dhcp_agent_notifier = dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
     self.agent_notifiers[const.AGENT_TYPE_DHCP] = (
         self._dhcp_agent_notifier)
     self.endpoints = [
         securitygroups_rpc.SecurityGroupServerRpcCallback(),
         dhcp_rpc.DhcpRpcCallback(),
         agents_db.AgentExtRpcCallback()
     ]
     self.conn.create_consumer(self.topic, self.endpoints, fanout=False)
     # Consume from all consumers in threads
     self.conn.consume_in_threads()
Ejemplo n.º 6
0
    def start_rpc_listeners(self):
        self.endpoints = [
            ml2_server_callback.NwaML2ServerRpcCallbacks(
                self.notifier, self.type_manager),
            nwa_l2_server_callback.NwaL2ServerRpcCallback(),
            tenant_binding_callback.TenantBindingServerRpcCallback(),
            securitygroups_rpc.SecurityGroupServerRpcCallback(),
            dhcp_rpc.DhcpRpcCallback(),
            agents_db.AgentExtRpcCallback(),
            metadata_rpc.MetadataRpcCallback()]

        self.topic = topics.PLUGIN
        self.conn = n_rpc.create_connection()
        self.conn.create_consumer(self.topic, self.endpoints,
                                  fanout=False)
        return self.conn.consume_in_threads()
Ejemplo n.º 7
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 = NVSDPluginV2AgentNotifierApi(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 = [
            securitygroups_rpc.SecurityGroupServerRpcCallback(),
            dhcp_rpc.DhcpRpcCallback(),
            l3_rpc.L3RpcCallback(),
            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()