Drop RpcProxy usage from oneconvergence plugin
This patch removes usage of the RpcProxy compatibility class from the oneconvergence plugin. The equivalent usage of oslo.messaging APIs is now used intead. Part of blueprint drop-rpc-compat. Change-Id: Ifa74849ba9e3dc09cbb8cb3a723aeaa2b25b87ad
This commit is contained in:
parent
177010dcbe
commit
05b5671d0f
|
@ -21,6 +21,8 @@ import time
|
|||
import eventlet
|
||||
eventlet.monkey_patch()
|
||||
|
||||
from oslo import messaging
|
||||
|
||||
from neutron.agent.linux import ovs_lib
|
||||
from neutron.agent import rpc as agent_rpc
|
||||
from neutron.agent import securitygroups_rpc as sg_rpc
|
||||
|
@ -57,11 +59,12 @@ class NVSDAgentRpcCallback(n_rpc.RpcCallback):
|
|||
self.sg_agent.refresh_firewall()
|
||||
|
||||
|
||||
class SecurityGroupServerRpcApi(n_rpc.RpcProxy,
|
||||
sg_rpc.SecurityGroupServerRpcApiMixin):
|
||||
class SecurityGroupServerRpcApi(sg_rpc.SecurityGroupServerRpcApiMixin):
|
||||
|
||||
def __init__(self, topic):
|
||||
super(SecurityGroupServerRpcApi, self).__init__(
|
||||
topic=topic, default_version=sg_rpc.SG_RPC_VERSION)
|
||||
self.topic = topic
|
||||
target = messaging.Target(topic=topic, version=sg_rpc.SG_RPC_VERSION)
|
||||
self.client = n_rpc.get_client(target)
|
||||
|
||||
|
||||
class SecurityGroupAgentRpcCallback(
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
"""Implementation of OneConvergence Neutron Plugin."""
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import importutils
|
||||
|
||||
|
@ -61,21 +62,18 @@ class SecurityGroupServerRpcMixin(sg_db_rpc.SecurityGroupServerRpcMixin):
|
|||
return port
|
||||
|
||||
|
||||
class NVSDPluginV2AgentNotifierApi(n_rpc.RpcProxy,
|
||||
sg_rpc.SecurityGroupAgentRpcApiMixin):
|
||||
|
||||
BASE_RPC_API_VERSION = '1.0'
|
||||
class NVSDPluginV2AgentNotifierApi(sg_rpc.SecurityGroupAgentRpcApiMixin):
|
||||
|
||||
def __init__(self, topic):
|
||||
super(NVSDPluginV2AgentNotifierApi, self).__init__(
|
||||
topic=topic, default_version=self.BASE_RPC_API_VERSION)
|
||||
self.topic = topic
|
||||
self.topic_port_update = topics.get_topic_name(topic, topics.PORT,
|
||||
topics.UPDATE)
|
||||
target = messaging.Target(topic=topic, version='1.0')
|
||||
self.client = n_rpc.get_client(target)
|
||||
|
||||
def port_update(self, context, port):
|
||||
self.fanout_cast(context,
|
||||
self.make_msg('port_update', port=port),
|
||||
topic=self.topic_port_update)
|
||||
cctxt = self.client.prepare(topic=self.topic_port_update, fanout=True)
|
||||
cctxt.cast(context, 'port_update', port=port)
|
||||
|
||||
|
||||
class OneConvergencePluginV2(db_base_plugin_v2.NeutronDbPluginV2,
|
||||
|
|
Loading…
Reference in New Issue