]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Drop RpcProxy usage from ibm plugin
authorRussell Bryant <rbryant@redhat.com>
Fri, 21 Nov 2014 20:00:06 +0000 (20:00 +0000)
committerRussell Bryant <rbryant@redhat.com>
Mon, 24 Nov 2014 21:01:42 +0000 (21:01 +0000)
Drop usage of the RpcProxy compatibility class from the ibm plugin.
Direct usage of oslo.messaging APIs is now done instead.

Part of blueprint drop-rpc-compat.

Change-Id: I3163d0a5e5f042c02e83995e84eb962e002f27cb

neutron/plugins/ibm/sdnve_neutron_plugin.py

index b48a87849d7ff22754dd187442e075037306e5d8..f90e18d8f4aed7af80706dcbc6d597f7c0940bde 100644 (file)
@@ -18,6 +18,7 @@
 import functools
 
 from oslo.config import cfg
+from oslo import messaging
 
 from neutron.common import constants as n_const
 from neutron.common import exceptions as n_exc
@@ -54,24 +55,19 @@ class SdnveRpcCallbacks():
         return info
 
 
-class AgentNotifierApi(n_rpc.RpcProxy):
+class AgentNotifierApi(object):
     '''Agent side of the SDN-VE rpc API.'''
 
-    BASE_RPC_API_VERSION = '1.0'
-
     def __init__(self, topic):
-        super(AgentNotifierApi, self).__init__(
-            topic=topic, default_version=self.BASE_RPC_API_VERSION)
-
+        target = messaging.Target(topic=topic, version='1.0')
+        self.client = n_rpc.get_client(target)
         self.topic_info_update = topics.get_topic_name(topic,
                                                        constants.INFO,
                                                        topics.UPDATE)
 
     def info_update(self, context, info):
-        self.fanout_cast(context,
-                         self.make_msg('info_update',
-                                       info=info),
-                         topic=self.topic_info_update)
+        cctxt = self.client.prepare(topic=self.topic_info_update, fanout=True)
+        cctxt.cast(context, 'info_update', info=info)
 
 
 def _ha(func):