Merge "Drop RpcProxy usage from oneconvergence plugin"

This commit is contained in:
Jenkins 2014-11-26 20:29:49 +00:00 committed by Gerrit Code Review
commit 9054d6b22a
2 changed files with 14 additions and 13 deletions

View File

@ -21,6 +21,8 @@ import time
import eventlet import eventlet
eventlet.monkey_patch() eventlet.monkey_patch()
from oslo import messaging
from neutron.agent.linux import ovs_lib from neutron.agent.linux import ovs_lib
from neutron.agent import rpc as agent_rpc from neutron.agent import rpc as agent_rpc
from neutron.agent import securitygroups_rpc as sg_rpc from neutron.agent import securitygroups_rpc as sg_rpc
@ -57,11 +59,12 @@ class NVSDAgentRpcCallback(n_rpc.RpcCallback):
self.sg_agent.refresh_firewall() self.sg_agent.refresh_firewall()
class SecurityGroupServerRpcApi(n_rpc.RpcProxy, class SecurityGroupServerRpcApi(sg_rpc.SecurityGroupServerRpcApiMixin):
sg_rpc.SecurityGroupServerRpcApiMixin):
def __init__(self, topic): def __init__(self, topic):
super(SecurityGroupServerRpcApi, self).__init__( self.topic = topic
topic=topic, default_version=sg_rpc.SG_RPC_VERSION) target = messaging.Target(topic=topic, version=sg_rpc.SG_RPC_VERSION)
self.client = n_rpc.get_client(target)
class SecurityGroupAgentRpcCallback( class SecurityGroupAgentRpcCallback(

View File

@ -15,6 +15,7 @@
"""Implementation of OneConvergence Neutron Plugin.""" """Implementation of OneConvergence Neutron Plugin."""
from oslo.config import cfg from oslo.config import cfg
from oslo import messaging
from oslo.utils import excutils from oslo.utils import excutils
from oslo.utils import importutils from oslo.utils import importutils
@ -61,21 +62,18 @@ class SecurityGroupServerRpcMixin(sg_db_rpc.SecurityGroupServerRpcMixin):
return port return port
class NVSDPluginV2AgentNotifierApi(n_rpc.RpcProxy, class NVSDPluginV2AgentNotifierApi(sg_rpc.SecurityGroupAgentRpcApiMixin):
sg_rpc.SecurityGroupAgentRpcApiMixin):
BASE_RPC_API_VERSION = '1.0'
def __init__(self, topic): def __init__(self, topic):
super(NVSDPluginV2AgentNotifierApi, self).__init__( self.topic = topic
topic=topic, default_version=self.BASE_RPC_API_VERSION)
self.topic_port_update = topics.get_topic_name(topic, topics.PORT, self.topic_port_update = topics.get_topic_name(topic, topics.PORT,
topics.UPDATE) topics.UPDATE)
target = messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def port_update(self, context, port): def port_update(self, context, port):
self.fanout_cast(context, cctxt = self.client.prepare(topic=self.topic_port_update, fanout=True)
self.make_msg('port_update', port=port), cctxt.cast(context, 'port_update', port=port)
topic=self.topic_port_update)
class OneConvergencePluginV2(db_base_plugin_v2.NeutronDbPluginV2, class OneConvergencePluginV2(db_base_plugin_v2.NeutronDbPluginV2,