Example #1
0
 def __init__(self, topic):
     super(AgentNotifierApi,
           self).__init__(topic=topic,
                          default_version=self.BASE_RPC_API_VERSION)
     self.topic_network_delete = topics.get_topic_name(
         topic, topics.NETWORK, topics.DELETE)
     self.topic_port_update = topics.get_topic_name(topic, topics.PORT,
                                                    topics.UPDATE)
Example #2
0
 def __init__(self, topic):
     super(AgentNotifierApi, self).__init__(
         topic=topic, default_version=self.BASE_RPC_API_VERSION)
     self.topic_network_delete = topics.get_topic_name(topic,
                                                       topics.NETWORK,
                                                       topics.DELETE)
     self.topic_port_update = topics.get_topic_name(topic,
                                                    topics.PORT,
                                                    topics.UPDATE)
Example #3
0
 def test_delete_network(self):
     rpcapi = plb.AgentNotifierApi(topics.AGENT)
     self._test_lb_api(rpcapi,
                       topics.get_topic_name(topics.AGENT,
                                             topics.NETWORK,
                                             topics.DELETE),
                       'network_delete', rpc_method='fanout_cast',
                       network_id='fake_request_spec')
Example #4
0
 def test_port_update(self):
     rpcapi = povs.AgentNotifierApi(topics.AGENT)
     self._test_ovs_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              topics.PORT,
                                              topics.UPDATE),
                        'port_update', rpc_method='fanout_cast',
                        port='fake_port', vlan_id='fake_vlan_id')
 def test_delete_network(self):
     rpcapi = povs.AgentNotifierApi(topics.AGENT)
     self._test_ovs_api(rpcapi,
                        topics.get_topic_name(topics.AGENT, topics.NETWORK,
                                              topics.DELETE),
                        'network_delete',
                        rpc_method='fanout_cast',
                        network_id='fake_request_spec')
Example #6
0
 def test_tunnel_update(self):
     rpcapi = povs.AgentNotifierApi(topics.AGENT)
     self._test_ovs_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              constants.TUNNEL,
                                              topics.UPDATE),
                        'tunnel_update', rpc_method='fanout_cast',
                        tunnel_ip='fake_ip', tunnel_id='fake_id')
 def test_delete_network(self):
     rpcapi = ana.AgentNotifierApi(topics.AGENT)
     self._test_hyperv_quantum_api(
         rpcapi,
         topics.get_topic_name(topics.AGENT, topics.NETWORK, topics.DELETE),
         "network_delete",
         rpc_method="fanout_cast",
         network_id="fake_request_spec",
     )
 def test_port_delete(self):
     rpcapi = ana.AgentNotifierApi(topics.AGENT)
     self._test_hyperv_quantum_api(
         rpcapi,
         topics.get_topic_name(topics.AGENT, topics.PORT, topics.DELETE),
         "port_delete",
         rpc_method="fanout_cast",
         port_id="port_id",
     )
 def test_tunnel_update(self):
     rpcapi = povs.AgentNotifierApi(topics.AGENT)
     self._test_ovs_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              constants.TUNNEL,
                                              topics.UPDATE),
                        'tunnel_update',
                        rpc_method='fanout_cast',
                        tunnel_ip='fake_ip',
                        tunnel_id='fake_id')
Example #10
0
 def test_port_update(self):
     rpcapi = plb.AgentNotifierApi(topics.AGENT)
     self._test_lb_api(rpcapi,
                       topics.get_topic_name(topics.AGENT, topics.PORT,
                                             topics.UPDATE),
                       'port_update',
                       rpc_method='fanout_cast',
                       port='fake_port',
                       physical_network='fake_net',
                       vlan_id='fake_vlan_id')
Example #11
0
 def test_port_update(self):
     rpcapi = plb.AgentNotifierApi(topics.AGENT)
     self._test_lb_api(
         rpcapi,
         topics.get_topic_name(topics.AGENT, topics.PORT, topics.UPDATE),
         "port_update",
         rpc_method="fanout_cast",
         port="fake_port",
         vlan_id="fake_vlan_id",
     )
Example #12
0
 def test_tunnel_update(self):
     rpcapi = ana.AgentNotifierApi(topics.AGENT)
     self._test_hyperv_quantum_api(
         rpcapi,
         topics.get_topic_name(topics.AGENT, constants.TUNNEL, topics.UPDATE),
         "tunnel_update",
         rpc_method="fanout_cast",
         tunnel_ip="fake_ip",
         tunnel_id="fake_id",
     )
Example #13
0
 def test_port_delete(self):
     rpcapi = ana.AgentNotifierApi(topics.AGENT)
     self._test_hyperv_quantum_api(
         rpcapi,
         topics.get_topic_name(
             topics.AGENT,
             topics.PORT,
             topics.DELETE),
         'port_delete', rpc_method='fanout_cast',
         port_id='port_id')
 def test_port_update(self):
     rpcapi = povs.AgentNotifierApi(topics.AGENT)
     self._test_ovs_api(rpcapi,
                        topics.get_topic_name(topics.AGENT, topics.PORT,
                                              topics.UPDATE),
                        'port_update',
                        rpc_method='fanout_cast',
                        port='fake_port',
                        network_type='fake_network_type',
                        segmentation_id='fake_segmentation_id',
                        physical_network='fake_physical_network')
Example #15
0
 def test_port_update(self):
     rpcapi = agent_notify_api.AgentNotifierApi(topics.AGENT)
     self._test_mlnx_api(rpcapi,
                         topics.get_topic_name(topics.AGENT,
                                               topics.PORT,
                                               topics.UPDATE),
                         'port_update', rpc_method='fanout_cast',
                         port='fake_port',
                         network_type='vlan',
                         physical_network='fake_net',
                         vlan_id='fake_vlan_id')
Example #16
0
 def test_port_update(self):
     rpcapi = povs.AgentNotifierApi(topics.AGENT)
     self._test_ovs_api(rpcapi,
                        topics.get_topic_name(topics.AGENT,
                                              topics.PORT,
                                              topics.UPDATE),
                        'port_update', rpc_method='fanout_cast',
                        port='fake_port',
                        network_type='fake_network_type',
                        segmentation_id='fake_segmentation_id',
                        physical_network='fake_physical_network')
Example #17
0
 def test_port_update(self):
     rpcapi = ana.AgentNotifierApi(topics.AGENT)
     self._test_hyperv_quantum_api(
         rpcapi,
         topics.get_topic_name(topics.AGENT, topics.PORT, topics.UPDATE),
         "port_update",
         rpc_method="fanout_cast",
         port="fake_port",
         network_type="fake_network_type",
         segmentation_id="fake_segmentation_id",
         physical_network="fake_physical_network",
     )
Example #18
0
File: rpc.py Project: Apsu/quantum
def create_consumers(dispatcher, prefix, topic_details):
    """Create agent RPC consumers.

    :param dispatcher: The dispatcher to process the incoming messages.
    :param prefix: Common prefix for the plugin/agent message queues.
    :param topic_details: A list of topics. Each topic has a name and a
                          operation.

    :returns: A common Connection.
    """

    connection = rpc.create_connection(new=True)
    for topic, operation in topic_details:
        topic_name = topics.get_topic_name(prefix, topic, operation)
        connection.create_consumer(topic_name, dispatcher, fanout=True)
    connection.consume_in_thread()
    return connection
Example #19
0
def create_consumers(dispatcher, prefix, topic_details):
    """Create agent RPC consumers.

    :param dispatcher: The dispatcher to process the incoming messages.
    :param prefix: Common prefix for the plugin/agent message queues.
    :param topic_details: A list of topics. Each topic has a name and a
                          operation.

    :returns: A common Connection.
    """

    connection = rpc.create_connection(new=True)
    for topic, operation in topic_details:
        topic_name = topics.get_topic_name(prefix, topic, operation)
        connection.create_consumer(topic_name, dispatcher, fanout=True)
    connection.consume_in_thread()
    return connection
Example #20
0
 def test_port_update(self):
     cfg.CONF.set_override('rpc_support_old_agents', False, 'AGENT')
     rpcapi = plb.AgentNotifierApi(topics.AGENT)
     expected_msg = rpcapi.make_msg('port_update',
                                    port='fake_port',
                                    network_type='vlan',
                                    physical_network='fake_net',
                                    segmentation_id='fake_vlan_id')
     self._test_lb_api(rpcapi,
                       topics.get_topic_name(topics.AGENT,
                                             topics.PORT,
                                             topics.UPDATE),
                       'port_update', rpc_method='fanout_cast',
                       expected_msg=expected_msg,
                       port='fake_port',
                       physical_network='fake_net',
                       vlan_id='fake_vlan_id')
Example #21
0
 def __init__(self, topic):
     super(NECPluginV2AgentNotifierApi, self).__init__(
         topic=topic, default_version=self.BASE_RPC_API_VERSION)
     self.topic_port_update = topics.get_topic_name(
         topic, topics.PORT, topics.UPDATE)
Example #22
0
 def __init__(self, topic):
     super(NECPluginV2AgentNotifierApi,
           self).__init__(topic=topic,
                          default_version=self.BASE_RPC_API_VERSION)
     self.topic_port_update = topics.get_topic_name(topic, topics.PORT,
                                                    topics.UPDATE)
Example #23
0
 def _get_security_group_topic(self):
     return topics.get_topic_name(self.topic,
                                  topics.SECURITY_GROUP,
                                  topics.UPDATE)
Example #24
0
 def _get_security_group_topic(self):
     return topics.get_topic_name(self.topic, topics.SECURITY_GROUP,
                                  topics.UPDATE)