]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Add new L3 RPC topic support to Ryu plugin
authorYoshihiro Kaneko <ykaneko0929@gmail.com>
Fri, 13 Sep 2013 05:56:22 +0000 (14:56 +0900)
committerYoshihiro Kaneko <ykaneko0929@gmail.com>
Fri, 13 Sep 2013 08:29:30 +0000 (17:29 +0900)
fixes bug #1224796

This patch adds RPC consumer for the new topic for L3 callbacks to
Ryu plugin.

Change-Id: Id9b3af474e65ab4c5b58121e1dcb160f80a71633

neutron/plugins/ryu/ryu_neutron_plugin.py

index 2f072a0ce8710f44608ef443c5d8e6ebdcaef8ae..7e2cbdfc46b58d989447b39cdb1cd832716633f6 100644 (file)
@@ -39,6 +39,7 @@ from neutron.extensions import portbindings
 from neutron.openstack.common import log as logging
 from neutron.openstack.common import rpc
 from neutron.openstack.common.rpc import proxy
+from neutron.plugins.common import constants as svc_constants
 from neutron.plugins.ryu.common import config  # noqa
 from neutron.plugins.ryu.db import api_v2 as db_api_v2
 
@@ -133,11 +134,14 @@ class RyuNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
         self._create_all_tenant_network()
 
     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 = AgentNotifierApi(topics.AGENT)
         self.callbacks = RyuRpcCallbacks(self.ofp_api_host)
         self.dispatcher = self.callbacks.create_rpc_dispatcher()
-        self.conn.create_consumer(topics.PLUGIN, self.dispatcher, fanout=False)
+        for svc_topic in self.service_topics.values():
+            self.conn.create_consumer(svc_topic, self.dispatcher, fanout=False)
         self.conn.consume_in_thread()
 
     def _create_all_tenant_network(self):