Merge "Drop RpcProxy usage from oneconvergence plugin"
This commit is contained in:
commit
9054d6b22a
@ -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…
x
Reference in New Issue
Block a user