Drop RpcProxy usage from ibm plugin
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
This commit is contained in:
parent
da575ec1ad
commit
2af516d60a
@ -18,6 +18,7 @@
|
|||||||
import functools
|
import functools
|
||||||
|
|
||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
from oslo import messaging
|
||||||
|
|
||||||
from neutron.common import constants as n_const
|
from neutron.common import constants as n_const
|
||||||
from neutron.common import exceptions as n_exc
|
from neutron.common import exceptions as n_exc
|
||||||
@ -54,24 +55,19 @@ class SdnveRpcCallbacks():
|
|||||||
return info
|
return info
|
||||||
|
|
||||||
|
|
||||||
class AgentNotifierApi(n_rpc.RpcProxy):
|
class AgentNotifierApi(object):
|
||||||
'''Agent side of the SDN-VE rpc API.'''
|
'''Agent side of the SDN-VE rpc API.'''
|
||||||
|
|
||||||
BASE_RPC_API_VERSION = '1.0'
|
|
||||||
|
|
||||||
def __init__(self, topic):
|
def __init__(self, topic):
|
||||||
super(AgentNotifierApi, self).__init__(
|
target = messaging.Target(topic=topic, version='1.0')
|
||||||
topic=topic, default_version=self.BASE_RPC_API_VERSION)
|
self.client = n_rpc.get_client(target)
|
||||||
|
|
||||||
self.topic_info_update = topics.get_topic_name(topic,
|
self.topic_info_update = topics.get_topic_name(topic,
|
||||||
constants.INFO,
|
constants.INFO,
|
||||||
topics.UPDATE)
|
topics.UPDATE)
|
||||||
|
|
||||||
def info_update(self, context, info):
|
def info_update(self, context, info):
|
||||||
self.fanout_cast(context,
|
cctxt = self.client.prepare(topic=self.topic_info_update, fanout=True)
|
||||||
self.make_msg('info_update',
|
cctxt.cast(context, 'info_update', info=info)
|
||||||
info=info),
|
|
||||||
topic=self.topic_info_update)
|
|
||||||
|
|
||||||
|
|
||||||
def _ha(func):
|
def _ha(func):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user