Added RpcProxy class

This class is intended for easy and iterative migration from
oslo-incubator RPC implementation to oslo.messaging. It will adapt
oslo.messaging API to old oslo-rpc interfaces.

Migrated all affected classes to the new RpcProxy class.

blueprint oslo-messaging

Change-Id: I1563c13b470b61eebc982ee81efee47732943d48
changes/89/96789/10
Ihar Hrachyshka 9 years ago
parent 6cde36c7dd
commit 98eb2a681b

@ -29,6 +29,7 @@ from neutron.agent.linux import ovs_lib # noqa
from neutron.agent import rpc as agent_rpc
from neutron.common import constants
from neutron.common import exceptions
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.common import utils
from neutron import context
@ -37,7 +38,6 @@ from neutron.openstack.common import importutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall
from neutron.openstack.common.rpc import common
from neutron.openstack.common.rpc import proxy
from neutron.openstack.common import service
from neutron import service as neutron_service
@ -376,7 +376,7 @@ class DhcpAgent(manager.Manager):
pm.disable()
class DhcpPluginApi(proxy.RpcProxy):
class DhcpPluginApi(rpc_compat.RpcProxy):
"""Agent side of the dhcp rpc API.
API version history:

@ -25,6 +25,7 @@ from neutron.agent.linux import iptables_manager
from neutron.agent.linux import ovs_lib # noqa
from neutron.agent import rpc as agent_rpc
from neutron.common import constants as l3_constants
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.common import utils as common_utils
from neutron import context
@ -37,7 +38,6 @@ from neutron.openstack.common import loopingcall
from neutron.openstack.common import periodic_task
from neutron.openstack.common import processutils
from neutron.openstack.common.rpc import common as rpc_common
from neutron.openstack.common.rpc import proxy
from neutron.openstack.common import service
from neutron import service as neutron_service
from neutron.services.firewall.agents.l3reference import firewall_l3_agent
@ -50,7 +50,7 @@ RPC_LOOP_INTERVAL = 1
FLOATING_IP_CIDR_SUFFIX = '/32'
class L3PluginApi(proxy.RpcProxy):
class L3PluginApi(rpc_compat.RpcProxy):
"""Agent side of the l3 agent RPC API.
API version history:

@ -17,11 +17,11 @@
import itertools
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.openstack.common import log as logging
from neutron.openstack.common import rpc
from neutron.openstack.common.rpc import proxy
from neutron.openstack.common import timeutils
@ -56,7 +56,7 @@ def create_consumers(dispatcher, prefix, topic_details):
return connection
class PluginReportStateAPI(proxy.RpcProxy):
class PluginReportStateAPI(rpc_compat.RpcProxy):
BASE_RPC_API_VERSION = '1.0'
def __init__(self, topic):
@ -74,7 +74,7 @@ class PluginReportStateAPI(proxy.RpcProxy):
return self.cast(context, msg, topic=self.topic)
class PluginApi(proxy.RpcProxy):
class PluginApi(rpc_compat.RpcProxy):
'''Agent side of the rpc API.
API version history:

@ -14,17 +14,17 @@
# limitations under the License.
from neutron.common import constants
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.common import utils
from neutron import manager
from neutron.openstack.common import log as logging
from neutron.openstack.common.rpc import proxy
LOG = logging.getLogger(__name__)
class DhcpAgentNotifyAPI(proxy.RpcProxy):
class DhcpAgentNotifyAPI(rpc_compat.RpcProxy):
"""API for plugin to notify DHCP agent."""
BASE_RPC_API_VERSION = '1.0'
# It seems dhcp agent does not support bulk operation

@ -14,18 +14,18 @@
# limitations under the License.
from neutron.common import constants
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.common import utils
from neutron import manager
from neutron.openstack.common import log as logging
from neutron.openstack.common.rpc import proxy
from neutron.plugins.common import constants as service_constants
LOG = logging.getLogger(__name__)
class L3AgentNotifyAPI(proxy.RpcProxy):
class L3AgentNotifyAPI(rpc_compat.RpcProxy):
"""API for plugin to notify L3 agent."""
BASE_RPC_API_VERSION = '1.0'

@ -15,17 +15,17 @@
# under the License.
from neutron.common import constants
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.common import utils
from neutron import manager
from neutron.openstack.common import log as logging
from neutron.openstack.common.rpc import proxy
from neutron.plugins.common import constants as service_constants
LOG = logging.getLogger(__name__)
class MeteringAgentNotifyAPI(proxy.RpcProxy):
class MeteringAgentNotifyAPI(rpc_compat.RpcProxy):
"""API for plugin to notify L3 metering agent."""
BASE_RPC_API_VERSION = '1.0'

@ -0,0 +1,25 @@
# Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from neutron.openstack.common.rpc import proxy
class RpcProxy(proxy.RpcProxy):
'''
This class is created to facilitate migration from oslo-incubator
RPC layer implementation to oslo.messaging and is intended to
emulate RpcProxy class behaviour using oslo.messaging API once the
migration is applied.
'''

@ -58,6 +58,7 @@ from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.common import constants as const
from neutron.common import exceptions
from neutron.common import rpc as q_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.common import utils
from neutron import context as qcontext
@ -96,7 +97,7 @@ SYNTAX_ERROR_MESSAGE = _('Syntax error in server config file, aborting plugin')
METADATA_SERVER_IP = '169.254.169.254'
class AgentNotifierApi(rpc.proxy.RpcProxy,
class AgentNotifierApi(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupAgentRpcApiMixin):
BASE_RPC_API_VERSION = '1.1'

@ -32,6 +32,7 @@ from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.common import constants as q_const
from neutron.common import rpc as q_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.common import utils
from neutron.db import agents_db
@ -51,7 +52,6 @@ from neutron.openstack.common import context
from neutron.openstack.common import importutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import rpc
from neutron.openstack.common.rpc import proxy
from neutron.plugins.brocade.db import models as brocade_db
from neutron.plugins.brocade import vlanbm as vbm
from neutron.plugins.common import constants as svc_constants
@ -166,7 +166,7 @@ class BridgeRpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin,
return entry
class AgentNotifierApi(proxy.RpcProxy,
class AgentNotifierApi(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupAgentRpcApiMixin):
"""Agent side of the linux bridge rpc API.

@ -16,15 +16,15 @@
# under the License.
# @author: Alessandro Pilotti, Cloudbase Solutions Srl
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.openstack.common import log as logging
from neutron.openstack.common.rpc import proxy
from neutron.plugins.hyperv.common import constants
LOG = logging.getLogger(__name__)
class AgentNotifierApi(proxy.RpcProxy):
class AgentNotifierApi(rpc_compat.RpcProxy):
'''Agent side of the openvswitch rpc API.
API version history:

@ -24,6 +24,7 @@ from oslo.config import cfg
from neutron.common import constants as n_const
from neutron.common import exceptions as n_exc
from neutron.common import rpc as n_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.db import agents_db
from neutron.db import db_base_plugin_v2
@ -35,7 +36,6 @@ from neutron.extensions import portbindings
from neutron.openstack.common import excutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import rpc
from neutron.openstack.common.rpc import proxy
from neutron.plugins.ibm.common import config # noqa
from neutron.plugins.ibm.common import constants
from neutron.plugins.ibm.common import exceptions as sdnve_exc
@ -66,7 +66,7 @@ class SdnveRpcCallbacks():
return info
class AgentNotifierApi(proxy.RpcProxy):
class AgentNotifierApi(rpc_compat.RpcProxy):
'''Agent side of the SDN-VE rpc API.'''
BASE_RPC_API_VERSION = '1.0'

@ -24,6 +24,7 @@ from neutron.api.v2 import attributes
from neutron.common import constants as q_const
from neutron.common import exceptions as n_exc
from neutron.common import rpc as q_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.common import utils
from neutron.db import agents_db
@ -45,7 +46,6 @@ from neutron import manager
from neutron.openstack.common import importutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import rpc
from neutron.openstack.common.rpc import proxy
from neutron.plugins.common import constants as svc_constants
from neutron.plugins.common import utils as plugin_utils
from neutron.plugins.linuxbridge.common import constants
@ -162,7 +162,7 @@ class LinuxBridgeRpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin,
LOG.debug(_("%s can not be found in database"), device)
class AgentNotifierApi(proxy.RpcProxy,
class AgentNotifierApi(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupAgentRpcApiMixin):
'''Agent side of the linux bridge rpc API.

@ -17,15 +17,15 @@
# @author: Francois Eleouet, Orange
# @author: Mathieu Rohon, Orange
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.openstack.common import log as logging
from neutron.openstack.common.rpc import proxy
LOG = logging.getLogger(__name__)
class L2populationAgentNotifyAPI(proxy.RpcProxy):
class L2populationAgentNotifyAPI(rpc_compat.RpcProxy):
BASE_RPC_API_VERSION = '1.0'
def __init__(self, topic=topics.AGENT):

@ -16,6 +16,7 @@
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.common import constants as q_const
from neutron.common import rpc as q_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.db import agents_db
from neutron.db import api as db_api
@ -23,7 +24,6 @@ from neutron.db import dhcp_rpc_base
from neutron.db import securitygroups_rpc_base as sg_db_rpc
from neutron import manager
from neutron.openstack.common import log
from neutron.openstack.common.rpc import proxy
from neutron.openstack.common import uuidutils
from neutron.plugins.ml2 import db
from neutron.plugins.ml2 import driver_api as api
@ -203,7 +203,7 @@ class RpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin,
q_const.PORT_STATUS_ACTIVE)
class AgentNotifierApi(proxy.RpcProxy,
class AgentNotifierApi(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupAgentRpcApiMixin,
type_tunnel.TunnelAgentRpcApiMixin):
"""Agent side of the openvswitch rpc API.

@ -17,14 +17,14 @@
from oslo.config import cfg
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.openstack.common import log as logging
from neutron.openstack.common.rpc import proxy
LOG = logging.getLogger(__name__)
class AgentNotifierApi(proxy.RpcProxy,
class AgentNotifierApi(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupAgentRpcApiMixin):
"""Agent side of the Embedded Switch RPC API.

@ -30,13 +30,13 @@ from neutron.agent import rpc as agent_rpc
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.common import config as logging_config
from neutron.common import constants as q_const
from neutron.common import rpc_compat
from neutron.common import topics
from neutron import context as q_context
from neutron.extensions import securitygroup as ext_sg
from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall
from neutron.openstack.common.rpc import dispatcher
from neutron.openstack.common.rpc import proxy
from neutron.plugins.nec.common import config
@ -82,7 +82,7 @@ class NECAgentRpcCallback(object):
self.sg_agent.refresh_firewall()
class SecurityGroupServerRpcApi(proxy.RpcProxy,
class SecurityGroupServerRpcApi(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupServerRpcApiMixin):
def __init__(self, topic):

@ -23,6 +23,7 @@ from neutron.api.v2 import attributes as attrs
from neutron.common import constants as const
from neutron.common import exceptions as n_exc
from neutron.common import rpc as q_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.db import agents_db
from neutron.db import agentschedulers_db
@ -41,7 +42,6 @@ from neutron.openstack.common import excutils
from neutron.openstack.common import importutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import rpc
from neutron.openstack.common.rpc import proxy
from neutron.openstack.common import uuidutils
from neutron.plugins.common import constants as svc_constants
from neutron.plugins.nec.common import config
@ -661,7 +661,7 @@ class NECPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
self.notify_security_groups_member_updated(context, port)
class NECPluginV2AgentNotifierApi(proxy.RpcProxy,
class NECPluginV2AgentNotifierApi(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupAgentRpcApiMixin):
'''RPC API for NEC plugin agent.'''

@ -25,12 +25,12 @@ from neutron.agent.linux import ovs_lib
from neutron.agent import rpc as agent_rpc
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.common import config as logging_config
from neutron.common import rpc_compat
from neutron.common import topics
from neutron import context as n_context
from neutron.extensions import securitygroup as ext_sg
from neutron.openstack.common import log as logging
from neutron.openstack.common.rpc import dispatcher
from neutron.openstack.common.rpc import proxy
from neutron.plugins.oneconvergence.lib import config
LOG = logging.getLogger(__name__)
@ -57,7 +57,7 @@ class NVSDAgentRpcCallback(object):
self.sg_agent.refresh_firewall()
class SecurityGroupServerRpcApi(proxy.RpcProxy,
class SecurityGroupServerRpcApi(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupServerRpcApiMixin):
def __init__(self, topic):
super(SecurityGroupServerRpcApi, self).__init__(

@ -24,6 +24,7 @@ from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.common import constants as q_const
from neutron.common import exceptions as nexception
from neutron.common import rpc as q_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.db import agents_db
from neutron.db import agentschedulers_db
@ -71,7 +72,7 @@ class NVSDPluginRpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin,
return port
class NVSDPluginV2AgentNotifierApi(rpc.proxy.RpcProxy,
class NVSDPluginV2AgentNotifierApi(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupAgentRpcApiMixin):
BASE_RPC_API_VERSION = '1.0'

@ -24,6 +24,7 @@ from neutron.api.v2 import attributes
from neutron.common import constants as q_const
from neutron.common import exceptions as n_exc
from neutron.common import rpc as q_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.common import utils
from neutron.db import agents_db
@ -48,7 +49,6 @@ from neutron import manager
from neutron.openstack.common import importutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import rpc
from neutron.openstack.common.rpc import proxy
from neutron.plugins.common import constants as svc_constants
from neutron.plugins.common import utils as plugin_utils
from neutron.plugins.openvswitch.common import config # noqa
@ -182,7 +182,7 @@ class OVSRpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin,
return entry
class AgentNotifierApi(proxy.RpcProxy,
class AgentNotifierApi(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupAgentRpcApiMixin):
'''Agent side of the openvswitch rpc API.

@ -24,6 +24,7 @@ from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.common import constants as q_const
from neutron.common import exceptions as n_exc
from neutron.common import rpc as q_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.db import api as db
from neutron.db import db_base_plugin_v2
@ -39,7 +40,6 @@ from neutron.extensions import portbindings
from neutron.openstack.common import excutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import rpc
from neutron.openstack.common.rpc import proxy
from neutron.plugins.common import constants as svc_constants
from neutron.plugins.ryu.common import config # noqa
from neutron.plugins.ryu.db import api_v2 as db_api_v2
@ -72,7 +72,7 @@ class RyuRpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin,
return port
class AgentNotifierApi(proxy.RpcProxy,
class AgentNotifierApi(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupAgentRpcApiMixin):
BASE_RPC_API_VERSION = '1.0'

@ -21,8 +21,8 @@
from oslo.config import cfg
from neutron.common import rpc_compat
from neutron.openstack.common import log as logging
from neutron.openstack.common.rpc import proxy
LOG = logging.getLogger(__name__)
@ -39,7 +39,7 @@ FWaaSOpts = [
cfg.CONF.register_opts(FWaaSOpts, 'fwaas')
class FWaaSPluginApiMixin(proxy.RpcProxy):
class FWaaSPluginApiMixin(rpc_compat.RpcProxy):
"""Agent side of the FWaaS agent to FWaaS Plugin RPC API."""
RPC_API_VERSION = '1.0'

@ -21,6 +21,7 @@ from oslo.config import cfg
from neutron.common import exceptions as n_exception
from neutron.common import rpc as q_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron import context as neutron_context
from neutron.db import api as qdbapi
@ -28,7 +29,6 @@ from neutron.db.firewall import firewall_db
from neutron.extensions import firewall as fw_ext
from neutron.openstack.common import log as logging
from neutron.openstack.common import rpc
from neutron.openstack.common.rpc import proxy
from neutron.plugins.common import constants as const
@ -97,7 +97,7 @@ class FirewallCallbacks(object):
return fw_tenant_list
class FirewallAgentApi(proxy.RpcProxy):
class FirewallAgentApi(rpc_compat.RpcProxy):
"""Plugin side of plugin to agent RPC API."""
API_VERSION = '1.0'

@ -16,10 +16,10 @@
#
# @author: Mark McClain, DreamHost
from neutron.openstack.common.rpc import proxy
from neutron.common import rpc_compat
class LbaasAgentApi(proxy.RpcProxy):
class LbaasAgentApi(rpc_compat.RpcProxy):
"""Agent side of the Agent to Plugin RPC API."""
API_VERSION = '2.0'

@ -23,6 +23,7 @@ from oslo.config import cfg
from neutron.common import constants as q_const
from neutron.common import exceptions as n_exc
from neutron.common import rpc as q_rpc
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.db import agents_db
from neutron.db.loadbalancer import loadbalancer_db
@ -31,7 +32,6 @@ from neutron.extensions import portbindings
from neutron.openstack.common import importutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import rpc
from neutron.openstack.common.rpc import proxy
from neutron.plugins.common import constants
from neutron.services.loadbalancer.drivers import abstract_driver
@ -239,7 +239,7 @@ class LoadBalancerCallbacks(object):
self.plugin.update_pool_stats(context, pool_id, data=stats)
class LoadBalancerAgentApi(proxy.RpcProxy):
class LoadBalancerAgentApi(rpc_compat.RpcProxy):
"""Plugin side of plugin to agent RPC API."""
BASE_RPC_API_VERSION = '2.0'

@ -22,6 +22,7 @@ from oslo.config import cfg
from neutron.agent.common import config
from neutron.agent import rpc as agent_rpc
from neutron.common import constants as constants
from neutron.common import rpc_compat
from neutron.common import topics
from neutron.common import utils
from neutron import context
@ -31,7 +32,6 @@ from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall
from neutron.openstack.common.notifier import api as notifier_api
from neutron.openstack.common import periodic_task
from neutron.openstack.common.rpc import proxy
from neutron.openstack.common import service
from neutron import service as neutron_service
@ -39,7 +39,7 @@ from neutron import service as neutron_service
LOG = logging.getLogger(__name__)
class MeteringPluginRpc(proxy.RpcProxy):
class MeteringPluginRpc(rpc_compat.RpcProxy):
BASE_RPC_API_VERSION = '1.0'

@ -24,12 +24,12 @@ import six
from neutron.common import exceptions
from neutron.common import rpc as n_rpc
from neutron.common import rpc_compat
from neutron import context as ctx
from neutron.openstack.common import lockutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall
from neutron.openstack.common import rpc
from neutron.openstack.common.rpc import proxy
from neutron.plugins.common import constants
from neutron.plugins.common import utils as plugin_utils
from neutron.services.vpn.common import topics
@ -151,7 +151,7 @@ def find_available_csrs_from_config(config_files):
return csrs_found
class CiscoCsrIPsecVpnDriverApi(proxy.RpcProxy):
class CiscoCsrIPsecVpnDriverApi(rpc_compat.RpcProxy):
"""RPC API for agent to plugin messaging."""
def get_vpn_services_on_host(self, context, host):

@ -28,12 +28,12 @@ import six
from neutron.agent.linux import ip_lib
from neutron.agent.linux import utils
from neutron.common import rpc as q_rpc
from neutron.common import rpc_compat
from neutron import context
from neutron.openstack.common import lockutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall
from neutron.openstack.common import rpc
from neutron.openstack.common.rpc import proxy
from neutron.plugins.common import constants
from neutron.plugins.common import utils as plugin_utils
from neutron.services.vpn.common import topics
@ -444,7 +444,7 @@ class OpenSwanProcess(BaseSwanProcess):
self.connection_status = {}
class IPsecVpnDriverApi(proxy.RpcProxy):
class IPsecVpnDriverApi(rpc_compat.RpcProxy):
"""IPSecVpnDriver RPC api."""
IPSEC_PLUGIN_VERSION = '1.0'

@ -19,9 +19,9 @@ import abc
import six
from neutron.common import rpc_compat
from neutron import manager
from neutron.openstack.common import log as logging
from neutron.openstack.common.rpc import proxy
from neutron.plugins.common import constants
LOG = logging.getLogger(__name__)
@ -51,7 +51,7 @@ class VpnDriver(object):
pass
class BaseIPsecVpnAgentApi(proxy.RpcProxy):
class BaseIPsecVpnAgentApi(rpc_compat.RpcProxy):
"""Base class for IPSec API to agent."""
def __init__(self, to_agent_topic, topic, default_version):

@ -117,11 +117,11 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
self.fanout_topic = topics.get_topic_name(topics.AGENT,
topics.L2POPULATION,
topics.UPDATE)
fanout = ('neutron.openstack.common.rpc.proxy.RpcProxy.fanout_cast')
fanout = ('neutron.common.rpc_compat.RpcProxy.fanout_cast')
fanout_patch = mock.patch(fanout)
self.mock_fanout = fanout_patch.start()
cast = ('neutron.openstack.common.rpc.proxy.RpcProxy.cast')
cast = ('neutron.common.rpc_compat.RpcProxy.cast')
cast_patch = mock.patch(cast)
self.mock_cast = cast_patch.start()

@ -83,8 +83,7 @@ class TestMeteringPlugin(test_db_plugin.NeutronDbPluginV2TestCase,
self.uuid_patch = mock.patch(uuid, return_value=self.uuid)
self.mock_uuid = self.uuid_patch.start()
fanout = ('neutron.openstack.common.rpc.proxy.RpcProxy.'
'fanout_cast')
fanout = ('neutron.common.rpc_compat.RpcProxy.fanout_cast')
self.fanout_patch = mock.patch(fanout)
self.mock_fanout = self.fanout_patch.start()
@ -291,7 +290,7 @@ class TestMeteringPluginL3AgentScheduler(
self.uuid_patch = mock.patch(uuid, return_value=self.uuid)
self.mock_uuid = self.uuid_patch.start()
cast = 'neutron.openstack.common.rpc.proxy.RpcProxy.cast'
cast = 'neutron.common.rpc_compat.RpcProxy.cast'
self.cast_patch = mock.patch(cast)
self.mock_cast = self.cast_patch.start()

@ -29,12 +29,12 @@ from neutron.agent import rpc as agent_rpc
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.common import constants as const
from neutron.common import ipv6_utils as ipv6
from neutron.common import rpc_compat
from neutron import context
from neutron.db import securitygroups_rpc_base as sg_db_rpc
from neutron.extensions import allowedaddresspairs as addr_pair
from neutron.extensions import securitygroup as ext_sg
from neutron import manager
from neutron.openstack.common.rpc import proxy
from neutron.tests import base
from neutron.tests.unit import test_extension_security_group as test_sg
@ -1102,7 +1102,7 @@ class SecurityGroupServerRpcApiTestCase(base.BaseTestCase):
topic='fake_topic')])
class FakeSGNotifierAPI(proxy.RpcProxy,
class FakeSGNotifierAPI(rpc_compat.RpcProxy,
sg_rpc.SecurityGroupAgentRpcApiMixin):
pass

Loading…
Cancel
Save