Ejemplo n.º 1
0
    def create_rpc_dispatcher(self):
        '''Get the rpc dispatcher for this manager.

        If a manager would like to set an rpc API version, or support more than
        one class as the target of rpc messages, override this method.
        '''
        return q_rpc.PluginRpcDispatcher([self])
Ejemplo n.º 2
0
    def setup_rpc(self):
        self.service_topics = {
            svc_constants.CORE: topics.PLUGIN,
            svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN
        }
        self.conn = 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 = SecurityGroupServerRpcCallback()
        callbacks = [
            NECPluginV2RPCCallbacks(self),
            DhcpRpcCallback(),
            L3RpcCallback(), self.callback_sg,
            agents_db.AgentExtRpcCallback()
        ]
        self.dispatcher = q_rpc.PluginRpcDispatcher(callbacks)
        for svc_topic in self.service_topics.values():
            self.conn.create_consumer(svc_topic, self.dispatcher, fanout=False)
        # Consume from all consumers in a thread
        self.conn.consume_in_thread()
Ejemplo n.º 3
0
    def create_rpc_dispatcher(self):
        """Get the rpc dispatcher for this rpc manager.

        If a manager would like to set an rpc API version, or support more than
        one class as the target of rpc messages, override this method.
        """
        return q_rpc.PluginRpcDispatcher(
            [self, agents_db.AgentExtRpcCallback()])
Ejemplo n.º 4
0
    def create_rpc_dispatcher(self):
        """Get the rpc dispatcher for this manager.

        This a basic implementation that will call the plugin like get_ports
        and handle basic events
        If a manager would like to set an rpc API version, or support more than
        one class as the target of rpc messages, override this method.
        """
        return n_rpc.PluginRpcDispatcher([self,
                                          agents_db.AgentExtRpcCallback()])
Ejemplo n.º 5
0
    def setup_rpc(self):
        self.topic = topics.PLUGIN
        self.conn = rpc.create_connection(new=True)
        self.notifier = NECPluginV2AgentNotifierApi(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.L3AgentNotify)

        # NOTE: callback_sg is referred to from the sg unit test.
        self.callback_sg = SecurityGroupServerRpcCallback()
        callbacks = [
            NECPluginV2RPCCallbacks(self),
            DhcpRpcCallback(),
            L3RpcCallback(), self.callback_sg,
            agents_db.AgentExtRpcCallback()
        ]
        self.dispatcher = q_rpc.PluginRpcDispatcher(callbacks)
        self.conn.create_consumer(self.topic, self.dispatcher, fanout=False)
        # Consume from all consumers in a thread
        self.conn.consume_in_thread()
Ejemplo n.º 6
0
 def create_rpc_dispatcher(self):
     return q_rpc.PluginRpcDispatcher(
         [self, agents_db.AgentExtRpcCallback(self.plugin)])
Ejemplo n.º 7
0
 def create_rpc_dispatcher(self):
     return q_rpc.PluginRpcDispatcher([self])
Ejemplo n.º 8
0
 def create_rpc_dispatcher(self):
     """Get the rpc dispatcher for this manager."""
     return q_rpc.PluginRpcDispatcher(
         [self, agents_db.AgentExtRpcCallback()])