]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Drop RpcProxy usage from cisco apic ml2 plugin
authorRussell Bryant <rbryant@redhat.com>
Mon, 24 Nov 2014 18:48:38 +0000 (18:48 +0000)
committerRussell Bryant <rbryant@redhat.com>
Wed, 26 Nov 2014 15:55:42 +0000 (15:55 +0000)
Drop usage fo the RpcProxy compatibility class from the cisco apic ml2
plugin.  The equivalent oslo.messaging APIs are now used instead.

Part of blueprint drop-rpc-compat.

Change-Id: I415b65720a09652bae70fc1c1dada9f5727c4441

neutron/plugins/ml2/drivers/cisco/apic/apic_topology.py

index 6be0b2a9fd0c7ecb4c9bc0b7660e8c6704237703..b75c76cd69e822816ea395909143d4be7bc07686 100644 (file)
@@ -21,6 +21,7 @@ import eventlet
 eventlet.monkey_patch()
 
 from oslo.config import cfg
+from oslo import messaging
 
 from neutron.agent.common import config
 from neutron.agent.linux import ip_lib
@@ -138,30 +139,21 @@ class ApicTopologyService(manager.Manager):
                 self.peers[(host, interface)] = nlink
 
 
-class ApicTopologyServiceNotifierApi(rpc.RpcProxy):
-
-    RPC_API_VERSION = '1.1'
+class ApicTopologyServiceNotifierApi(object):
 
     def __init__(self):
-        super(ApicTopologyServiceNotifierApi, self).__init__(
-            topic=TOPIC_APIC_SERVICE,
-            default_version=self.RPC_API_VERSION)
+        target = messaging.Target(topic=TOPIC_APIC_SERVICE, version='1.0')
+        self.client = rpc.get_client(target)
 
     def update_link(self, context, host, interface, mac, switch, module, port):
-        self.fanout_cast(
-            context, self.make_msg(
-                'update_link',
-                host=host, interface=interface, mac=mac,
-                switch=switch, module=module, port=port),
-            topic=TOPIC_APIC_SERVICE)
+        cctxt = self.client.prepare(version='1.1', fanout=True)
+        cctxt.cast(context, 'update_link', host=host, interface=interface,
+                   mac=mac, switch=switch, module=module, port=port)
 
     def delete_link(self, context, host, interface):
-        self.fanout_cast(
-            context, self.make_msg(
-                'delete_link',
-                host=host, interface=interface, mac=None,
-                switch=0, module=0, port=0),
-            topic=TOPIC_APIC_SERVICE)
+        cctxt = self.client.prepare(version='1.1', fanout=True)
+        cctxt.cast(context, 'delete_link', host=host, interface=interface,
+                   mac=None, switch=0, module=0, port=0)
 
 
 class ApicTopologyAgent(manager.Manager):