]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Moved rpc_compat.py code back into rpc.py
authorIhar Hrachyshka <ihrachys@redhat.com>
Mon, 9 Jun 2014 14:09:26 +0000 (16:09 +0200)
committerIhar Hrachyshka <ihrachys@redhat.com>
Tue, 24 Jun 2014 08:35:39 +0000 (10:35 +0200)
Most of this code will probably stay with us for quite some time, so
let's make things easier and consider them as our way of doing RPC.

blueprint oslo-messaging

Change-Id: Iaf353b23f9c54b82d1e02a6bd5a5960cec827c88

72 files changed:
neutron/agent/dhcp_agent.py
neutron/agent/l3_agent.py
neutron/agent/rpc.py
neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py
neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py
neutron/api/rpc/agentnotifiers/metering_rpc_agent_api.py
neutron/common/rpc.py
neutron/common/rpc_compat.py [deleted file]
neutron/db/agents_db.py
neutron/manager.py
neutron/plugins/bigswitch/agent/restproxy_agent.py
neutron/plugins/bigswitch/plugin.py
neutron/plugins/brocade/NeutronPlugin.py
neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py
neutron/plugins/hyperv/agent/hyperv_neutron_agent.py
neutron/plugins/hyperv/agent_notifier_api.py
neutron/plugins/hyperv/hyperv_neutron_plugin.py
neutron/plugins/hyperv/rpc_callbacks.py
neutron/plugins/ibm/agent/sdnve_neutron_agent.py
neutron/plugins/ibm/sdnve_neutron_plugin.py
neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
neutron/plugins/linuxbridge/lb_neutron_plugin.py
neutron/plugins/midonet/plugin.py
neutron/plugins/ml2/drivers/l2pop/rpc.py
neutron/plugins/ml2/plugin.py
neutron/plugins/ml2/rpc.py
neutron/plugins/mlnx/agent/eswitch_neutron_agent.py
neutron/plugins/mlnx/agent_notify_api.py
neutron/plugins/mlnx/mlnx_plugin.py
neutron/plugins/mlnx/rpc_callbacks.py
neutron/plugins/nec/agent/nec_neutron_agent.py
neutron/plugins/nec/nec_plugin.py
neutron/plugins/ofagent/agent/ofa_neutron_agent.py
neutron/plugins/oneconvergence/agent/nvsd_neutron_agent.py
neutron/plugins/oneconvergence/plugin.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/plugins/openvswitch/ovs_neutron_plugin.py
neutron/plugins/ryu/agent/ryu_neutron_agent.py
neutron/plugins/ryu/ryu_neutron_plugin.py
neutron/plugins/vmware/dhcp_meta/rpc.py
neutron/plugins/vmware/dhcpmeta_modes.py
neutron/service.py
neutron/services/firewall/agents/firewall_agent_api.py
neutron/services/firewall/fwaas_plugin.py
neutron/services/l3_router/l3_router_plugin.py
neutron/services/loadbalancer/agent/agent.py
neutron/services/loadbalancer/agent/agent_api.py
neutron/services/loadbalancer/agent/agent_manager.py
neutron/services/loadbalancer/drivers/common/agent_driver_base.py
neutron/services/metering/agents/metering_agent.py
neutron/services/metering/metering_plugin.py
neutron/services/vpn/device_drivers/cisco_ipsec.py
neutron/services/vpn/device_drivers/ipsec.py
neutron/services/vpn/service_drivers/__init__.py
neutron/services/vpn/service_drivers/cisco_ipsec.py
neutron/services/vpn/service_drivers/ipsec.py
neutron/tests/base.py
neutron/tests/unit/hyperv/test_hyperv_rpcapi.py
neutron/tests/unit/linuxbridge/test_rpcapi.py
neutron/tests/unit/ml2/drivers/test_l2population.py
neutron/tests/unit/ml2/test_rpcapi.py
neutron/tests/unit/mlnx/test_rpcapi.py
neutron/tests/unit/openvswitch/test_ovs_rpcapi.py
neutron/tests/unit/services/loadbalancer/agent/test_agent.py
neutron/tests/unit/services/metering/test_metering_plugin.py
neutron/tests/unit/services/vpn/device_drivers/test_cisco_ipsec.py
neutron/tests/unit/services/vpn/device_drivers/test_ipsec.py
neutron/tests/unit/services/vpn/service_drivers/test_cisco_ipsec.py
neutron/tests/unit/services/vpn/service_drivers/test_ipsec.py
neutron/tests/unit/test_agent_rpc.py
neutron/tests/unit/test_dhcp_agent.py
neutron/tests/unit/test_security_groups_rpc.py

index 61325291efd9540032a855b9311c2bf8dd32c342..29119799e4215d497e7e009f1f48678159482040 100644 (file)
@@ -31,7 +31,7 @@ from neutron.agent import rpc as agent_rpc
 from neutron.common import config as common_config
 from neutron.common import constants
 from neutron.common import exceptions
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils
 from neutron import context
@@ -137,7 +137,7 @@ class DhcpAgent(manager.Manager):
                         % {'net_id': network.id, 'action': action})
         except Exception as e:
             self.schedule_resync(e)
-            if (isinstance(e, rpc_compat.RemoteError)
+            if (isinstance(e, n_rpc.RemoteError)
                 and e.exc_type == 'NetworkNotFound'
                 or isinstance(e, exceptions.NetworkNotFound)):
                 LOG.warning(_("Network %s has been deleted."), network.id)
@@ -377,7 +377,7 @@ class DhcpAgent(manager.Manager):
         pm.disable()
 
 
-class DhcpPluginApi(rpc_compat.RpcProxy):
+class DhcpPluginApi(n_rpc.RpcProxy):
     """Agent side of the dhcp rpc API.
 
     API version history:
index 7dcb81e3b40fd6fbf03ff724ba9e89b47986a6ac..e4c5aff49f5e19fa34f843144072a8049ac1f799 100644 (file)
@@ -30,7 +30,7 @@ from neutron.agent.linux import ovs_lib  # noqa
 from neutron.agent import rpc as agent_rpc
 from neutron.common import config as common_config
 from neutron.common import constants as l3_constants
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils as common_utils
 from neutron import context
@@ -54,7 +54,7 @@ RPC_LOOP_INTERVAL = 1
 FLOATING_IP_CIDR_SUFFIX = '/32'
 
 
-class L3PluginApi(rpc_compat.RpcProxy):
+class L3PluginApi(n_rpc.RpcProxy):
     """Agent side of the l3 agent RPC API.
 
     API version history:
@@ -80,9 +80,9 @@ class L3PluginApi(rpc_compat.RpcProxy):
     def get_external_network_id(self, context):
         """Make a remote process call to retrieve the external network id.
 
-        @raise rpc_compat.RemoteError: with TooManyExternalNetworks
-                                       as exc_type if there are
-                                       more than one external network
+        @raise n_rpc.RemoteError: with TooManyExternalNetworks as
+                                  exc_type if there are more than one
+                                  external network
         """
         return self.call(context,
                          self.make_msg('get_external_network_id',
@@ -328,7 +328,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, manager.Manager):
             self.target_ex_net_id = self.plugin_rpc.get_external_network_id(
                 self.context)
             return self.target_ex_net_id
-        except rpc_compat.RemoteError as e:
+        except n_rpc.RemoteError as e:
             with excutils.save_and_reraise_exception() as ctx:
                 if e.exc_type == 'TooManyExternalNetworks':
                     ctx.reraise = False
@@ -861,7 +861,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback, manager.Manager):
             self._process_routers(routers, all_routers=True)
             self.fullsync = False
             LOG.debug(_("_sync_routers_task successfully completed"))
-        except rpc_compat.RPCException:
+        except n_rpc.RPCException:
             LOG.exception(_("Failed synchronizing routers due to RPC error"))
             self.fullsync = True
             return
index d497c65fba37181177621d82e1bb604578cded5f..2f60f125890acc2058713f293c9f05bc35adf24f 100644 (file)
@@ -15,7 +15,7 @@
 
 import itertools
 
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 
 from neutron.openstack.common import log as logging
@@ -37,7 +37,7 @@ def create_consumers(endpoints, prefix, topic_details):
     :returns: A common Connection.
     """
 
-    connection = rpc_compat.create_connection(new=True)
+    connection = n_rpc.create_connection(new=True)
     for details in topic_details:
         topic, operation, node_name = itertools.islice(
             itertools.chain(details, [None]), 3)
@@ -53,7 +53,7 @@ def create_consumers(endpoints, prefix, topic_details):
     return connection
 
 
-class PluginReportStateAPI(rpc_compat.RpcProxy):
+class PluginReportStateAPI(n_rpc.RpcProxy):
     BASE_RPC_API_VERSION = '1.0'
 
     def __init__(self, topic):
@@ -71,7 +71,7 @@ class PluginReportStateAPI(rpc_compat.RpcProxy):
             return self.cast(context, msg, topic=self.topic)
 
 
-class PluginApi(rpc_compat.RpcProxy):
+class PluginApi(n_rpc.RpcProxy):
     '''Agent side of the rpc API.
 
     API version history:
index 71ca52c25492d34949e76360884ef28d1a95157a..96c50bce918250be10431635e74b487c732e1b42 100644 (file)
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 from neutron.common import constants
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils
 from neutron import manager
@@ -24,7 +24,7 @@ from neutron.openstack.common import log as logging
 LOG = logging.getLogger(__name__)
 
 
-class DhcpAgentNotifyAPI(rpc_compat.RpcProxy):
+class DhcpAgentNotifyAPI(n_rpc.RpcProxy):
     """API for plugin to notify DHCP agent."""
     BASE_RPC_API_VERSION = '1.0'
     # It seems dhcp agent does not support bulk operation
index 9bf1080dbbbf8bdb0402737e16d222b177a5b4bf..0515ba40f582eb7dfe5d7c759c76457ff953b93c 100644 (file)
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 from neutron.common import constants
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils
 from neutron import manager
@@ -25,7 +25,7 @@ from neutron.plugins.common import constants as service_constants
 LOG = logging.getLogger(__name__)
 
 
-class L3AgentNotifyAPI(rpc_compat.RpcProxy):
+class L3AgentNotifyAPI(n_rpc.RpcProxy):
     """API for plugin to notify L3 agent."""
     BASE_RPC_API_VERSION = '1.0'
 
index da38cd8f80dacd675a31de48928437cdc1951bf4..e00e73b39f382b28035a7da9fe596ab9810624c6 100644 (file)
@@ -15,7 +15,7 @@
 # under the License.
 
 from neutron.common import constants
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils
 from neutron import manager
@@ -25,7 +25,7 @@ from neutron.plugins.common import constants as service_constants
 LOG = logging.getLogger(__name__)
 
 
-class MeteringAgentNotifyAPI(rpc_compat.RpcProxy):
+class MeteringAgentNotifyAPI(n_rpc.RpcProxy):
     """API for plugin to notify L3 metering agent."""
     BASE_RPC_API_VERSION = '1.0'
 
index 73a1090f297db082eca30e855c3566dad728ce2a..3800a683dfe0625e338edf7ef30f1e0eb4139b09 100644 (file)
@@ -1,4 +1,5 @@
 # Copyright (c) 2012 OpenStack Foundation.
+# Copyright (c) 2014 Red Hat, Inc.
 # All Rights Reserved.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -20,6 +21,7 @@ from oslo.messaging import serializer as om_serializer
 from neutron.common import exceptions
 from neutron import context
 from neutron.openstack.common import log as logging
+from neutron.openstack.common import service
 
 
 LOG = logging.getLogger(__name__)
@@ -133,3 +135,144 @@ class RequestContextSerializer(om_serializer.Serializer):
             tenant_id = rpc_ctxt_dict.pop('project_id', None)
         return context.Context(user_id, tenant_id,
                                load_admin_roles=False, **rpc_ctxt_dict)
+
+
+class RpcProxy(object):
+    '''
+    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.
+    '''
+    RPC_API_NAMESPACE = None
+
+    def __init__(self, topic, default_version, version_cap=None):
+        self.topic = topic
+        target = messaging.Target(topic=topic, version=default_version)
+        self._client = get_client(target, version_cap=version_cap)
+
+    def make_msg(self, method, **kwargs):
+        return {'method': method,
+                'namespace': self.RPC_API_NAMESPACE,
+                'args': kwargs}
+
+    def call(self, context, msg, **kwargs):
+        return self.__call_rpc_method(
+            context, msg, rpc_method='call', **kwargs)
+
+    def cast(self, context, msg, **kwargs):
+        self.__call_rpc_method(context, msg, rpc_method='cast', **kwargs)
+
+    def fanout_cast(self, context, msg, **kwargs):
+        kwargs['fanout'] = True
+        self.__call_rpc_method(context, msg, rpc_method='cast', **kwargs)
+
+    def __call_rpc_method(self, context, msg, **kwargs):
+        options = dict(
+            ((opt, kwargs[opt])
+             for opt in ('fanout', 'timeout', 'topic', 'version')
+             if kwargs.get(opt))
+        )
+        if msg['namespace']:
+            options['namespace'] = msg['namespace']
+
+        if options:
+            callee = self._client.prepare(**options)
+        else:
+            callee = self._client
+
+        func = getattr(callee, kwargs['rpc_method'])
+        return func(context, msg['method'], **msg['args'])
+
+
+class RpcCallback(object):
+    '''
+    This class is created to facilitate migration from oslo-incubator
+    RPC layer implementation to oslo.messaging and is intended to set
+    callback version using oslo.messaging API once the migration is
+    applied.
+    '''
+    RPC_API_VERSION = '1.0'
+
+    def __init__(self):
+        super(RpcCallback, self).__init__()
+        self.target = messaging.Target(version=self.RPC_API_VERSION)
+
+
+class Service(service.Service):
+    """Service object for binaries running on hosts.
+
+    A service enables rpc by listening to queues based on topic and host.
+    """
+    def __init__(self, host, topic, manager=None, serializer=None):
+        super(Service, self).__init__()
+        self.host = host
+        self.topic = topic
+        self.serializer = serializer
+        if manager is None:
+            self.manager = self
+        else:
+            self.manager = manager
+
+    def start(self):
+        super(Service, self).start()
+
+        self.conn = create_connection(new=True)
+        LOG.debug("Creating Consumer connection for Service %s" %
+                  self.topic)
+
+        endpoints = [self.manager]
+
+        # Share this same connection for these Consumers
+        self.conn.create_consumer(self.topic, endpoints, fanout=False)
+
+        node_topic = '%s.%s' % (self.topic, self.host)
+        self.conn.create_consumer(node_topic, endpoints, fanout=False)
+
+        self.conn.create_consumer(self.topic, endpoints, fanout=True)
+
+        # Hook to allow the manager to do other initializations after
+        # the rpc connection is created.
+        if callable(getattr(self.manager, 'initialize_service_hook', None)):
+            self.manager.initialize_service_hook(self)
+
+        # Consume from all consumers in threads
+        self.conn.consume_in_threads()
+
+    def stop(self):
+        # Try to shut the connection down, but if we get any sort of
+        # errors, go ahead and ignore them.. as we're shutting down anyway
+        try:
+            self.conn.close()
+        except Exception:
+            pass
+        super(Service, self).stop()
+
+
+class Connection(object):
+
+    def __init__(self):
+        super(Connection, self).__init__()
+        self.servers = []
+
+    def create_consumer(self, topic, endpoints, fanout=False):
+        target = messaging.Target(
+            topic=topic, server=cfg.CONF.host, fanout=fanout)
+        server = get_server(target, endpoints)
+        self.servers.append(server)
+
+    def consume_in_threads(self):
+        for server in self.servers:
+            server.start()
+        return self.servers
+
+
+# functions
+def create_connection(new=True):
+    return Connection()
+
+
+# exceptions
+RPCException = messaging.MessagingException
+RemoteError = messaging.RemoteError
+MessagingTimeout = messaging.MessagingTimeout
diff --git a/neutron/common/rpc_compat.py b/neutron/common/rpc_compat.py
deleted file mode 100644 (file)
index 8c16c2c..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-# 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 oslo.config import cfg
-from oslo import messaging
-
-from neutron.common import rpc as n_rpc
-from neutron.openstack.common import log as logging
-from neutron.openstack.common import service
-
-
-LOG = logging.getLogger(__name__)
-
-
-class RpcProxy(object):
-    '''
-    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.
-    '''
-    RPC_API_NAMESPACE = None
-
-    def __init__(self, topic, default_version, version_cap=None):
-        self.topic = topic
-        target = messaging.Target(topic=topic, version=default_version)
-        self._client = n_rpc.get_client(target, version_cap=version_cap)
-
-    def make_msg(self, method, **kwargs):
-        return {'method': method,
-                'namespace': self.RPC_API_NAMESPACE,
-                'args': kwargs}
-
-    def call(self, context, msg, **kwargs):
-        return self.__call_rpc_method(
-            context, msg, rpc_method='call', **kwargs)
-
-    def cast(self, context, msg, **kwargs):
-        self.__call_rpc_method(context, msg, rpc_method='cast', **kwargs)
-
-    def fanout_cast(self, context, msg, **kwargs):
-        kwargs['fanout'] = True
-        self.__call_rpc_method(context, msg, rpc_method='cast', **kwargs)
-
-    def __call_rpc_method(self, context, msg, **kwargs):
-        options = dict(
-            ((opt, kwargs[opt])
-             for opt in ('fanout', 'timeout', 'topic', 'version')
-             if kwargs.get(opt))
-        )
-        if msg['namespace']:
-            options['namespace'] = msg['namespace']
-
-        if options:
-            callee = self._client.prepare(**options)
-        else:
-            callee = self._client
-
-        func = getattr(callee, kwargs['rpc_method'])
-        return func(context, msg['method'], **msg['args'])
-
-
-class RpcCallback(object):
-    '''
-    This class is created to facilitate migration from oslo-incubator
-    RPC layer implementation to oslo.messaging and is intended to set
-    callback version using oslo.messaging API once the migration is
-    applied.
-    '''
-    RPC_API_VERSION = '1.0'
-
-    def __init__(self):
-        super(RpcCallback, self).__init__()
-        self.target = messaging.Target(version=self.RPC_API_VERSION)
-
-
-class Service(service.Service):
-    """Service object for binaries running on hosts.
-
-    A service enables rpc by listening to queues based on topic and host.
-    """
-    def __init__(self, host, topic, manager=None, serializer=None):
-        super(Service, self).__init__()
-        self.host = host
-        self.topic = topic
-        self.serializer = serializer
-        if manager is None:
-            self.manager = self
-        else:
-            self.manager = manager
-
-    def start(self):
-        super(Service, self).start()
-
-        self.conn = create_connection(new=True)
-        LOG.debug("Creating Consumer connection for Service %s" %
-                  self.topic)
-
-        endpoints = [self.manager]
-
-        # Share this same connection for these Consumers
-        self.conn.create_consumer(self.topic, endpoints, fanout=False)
-
-        node_topic = '%s.%s' % (self.topic, self.host)
-        self.conn.create_consumer(node_topic, endpoints, fanout=False)
-
-        self.conn.create_consumer(self.topic, endpoints, fanout=True)
-
-        # Hook to allow the manager to do other initializations after
-        # the rpc connection is created.
-        if callable(getattr(self.manager, 'initialize_service_hook', None)):
-            self.manager.initialize_service_hook(self)
-
-        # Consume from all consumers in threads
-        self.conn.consume_in_threads()
-
-    def stop(self):
-        # Try to shut the connection down, but if we get any sort of
-        # errors, go ahead and ignore them.. as we're shutting down anyway
-        try:
-            self.conn.close()
-        except Exception:
-            pass
-        super(Service, self).stop()
-
-
-class Connection(object):
-
-    def __init__(self):
-        super(Connection, self).__init__()
-        self.servers = []
-
-    def create_consumer(self, topic, endpoints, fanout=False):
-        target = messaging.Target(
-            topic=topic, server=cfg.CONF.host, fanout=fanout)
-        server = n_rpc.get_server(target, endpoints)
-        self.servers.append(server)
-
-    def consume_in_threads(self):
-        for server in self.servers:
-            server.start()
-        return self.servers
-
-
-# functions
-def create_connection(new=True):
-    return Connection()
-
-
-# exceptions
-RPCException = messaging.MessagingException
-RemoteError = messaging.RemoteError
-MessagingTimeout = messaging.MessagingTimeout
index 57712066ada4f0950eb6a804733244f33418df9c..6e8421e9e445e820174e2dbe5ab43e427b160444 100644 (file)
@@ -19,7 +19,7 @@ from oslo.config import cfg
 import sqlalchemy as sa
 from sqlalchemy.orm import exc
 
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.db import model_base
 from neutron.db import models_v2
 from neutron.extensions import agent as ext_agent
@@ -196,7 +196,7 @@ class AgentDbMixin(ext_agent.AgentPluginBase):
                     return self._create_or_update_agent(context, agent)
 
 
-class AgentExtRpcCallback(rpc_compat.RpcCallback):
+class AgentExtRpcCallback(n_rpc.RpcCallback):
     """Processes the rpc report in plugin implementations."""
 
     RPC_API_VERSION = '1.0'
index a84056d2f380f4b077ee641f117a7bcc335a6650..3a21f617f5908119c632693018acced99b67d829 100644 (file)
@@ -17,7 +17,7 @@ import weakref
 
 from oslo.config import cfg
 
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import utils
 from neutron.openstack.common import importutils
 from neutron.openstack.common import log as logging
@@ -30,7 +30,7 @@ from stevedore import driver
 LOG = logging.getLogger(__name__)
 
 
-class Manager(rpc_compat.RpcCallback, periodic_task.PeriodicTasks):
+class Manager(n_rpc.RpcCallback, periodic_task.PeriodicTasks):
 
     # Set RPC API version to 1.0 by default.
     RPC_API_VERSION = '1.0'
index 97aa7d0e3f4e22063e6f4a7344356fdb1c366025..caf57e4bf60efe148976c626a347ba338fbf14aa 100644 (file)
@@ -30,7 +30,7 @@ from neutron.agent.linux import utils
 from neutron.agent import rpc as agent_rpc
 from neutron.agent import securitygroups_rpc as sg_rpc
 from neutron.common import config
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron import context as q_context
 from neutron.extensions import securitygroup as ext_sg
@@ -84,7 +84,7 @@ class SecurityGroupAgent(sg_rpc.SecurityGroupAgentRpcMixin):
         self.init_firewall()
 
 
-class RestProxyAgent(rpc_compat.RpcCallback,
+class RestProxyAgent(n_rpc.RpcCallback,
                      sg_rpc.SecurityGroupAgentRpcCallbackMixin):
 
     RPC_API_VERSION = '1.1'
index fa3b1f76677af8ddb0f0e7132c78f2366fd2aa3e..ef9cc03cd7674001715615619c1d118108a3ba60 100644 (file)
@@ -56,7 +56,7 @@ from neutron.api import extensions as neutron_extensions
 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_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils
 from neutron import context as qcontext
@@ -94,7 +94,7 @@ SYNTAX_ERROR_MESSAGE = _('Syntax error in server config file, aborting plugin')
 METADATA_SERVER_IP = '169.254.169.254'
 
 
-class AgentNotifierApi(rpc_compat.RpcProxy,
+class AgentNotifierApi(n_rpc.RpcProxy,
                        sg_rpc.SecurityGroupAgentRpcApiMixin):
 
     BASE_RPC_API_VERSION = '1.1'
@@ -112,7 +112,7 @@ class AgentNotifierApi(rpc_compat.RpcProxy,
                          topic=self.topic_port_update)
 
 
-class RestProxyCallbacks(rpc_compat.RpcCallback,
+class RestProxyCallbacks(n_rpc.RpcCallback,
                          sg_rpc_base.SecurityGroupServerRpcCallbackMixin,
                          dhcp_rpc_base.DhcpRpcCallbackMixin):
 
@@ -493,7 +493,7 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
         LOG.debug(_("NeutronRestProxyV2: initialization done"))
 
     def _setup_rpc(self):
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.topic = topics.PLUGIN
         self.notifier = AgentNotifierApi(topics.AGENT)
         # init dhcp agent support
index d4b49ddc0c5339d3547354b951341acba10a607a..bac256a3806a7d0c91af30a89b8b05e4bb0c6240 100644 (file)
@@ -29,7 +29,7 @@ from neutron.agent import securitygroups_rpc as sg_rpc
 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_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils
 from neutron.db import agents_db
@@ -77,7 +77,7 @@ cfg.CONF.register_opts(SWITCH_OPTS, "SWITCH")
 cfg.CONF.register_opts(PHYSICAL_INTERFACE_OPTS, "PHYSICAL_INTERFACE")
 
 
-class BridgeRpcCallbacks(rpc_compat.RpcCallback,
+class BridgeRpcCallbacks(n_rpc.RpcCallback,
                          dhcp_rpc_base.DhcpRpcCallbackMixin,
                          l3_rpc_base.L3RpcCallbackMixin,
                          sg_db_rpc.SecurityGroupServerRpcCallbackMixin):
@@ -154,7 +154,7 @@ class BridgeRpcCallbacks(rpc_compat.RpcCallback,
         return entry
 
 
-class AgentNotifierApi(rpc_compat.RpcProxy,
+class AgentNotifierApi(n_rpc.RpcProxy,
                        sg_rpc.SecurityGroupAgentRpcApiMixin):
     """Agent side of the linux bridge rpc API.
 
@@ -251,7 +251,7 @@ class BrocadePluginV2(db_base_plugin_v2.NeutronDbPluginV2,
                                svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN}
         self.rpc_context = context.RequestContext('neutron', 'neutron',
                                                   is_admin=False)
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.endpoints = [BridgeRpcCallbacks(),
                           agents_db.AgentExtRpcCallback()]
         for svc_topic in self.service_topics.values():
index 220a9077dc3fab8a5f85ecef3a10ceacbb738f6b..431cbc6d8be9a9340cfb4b576b71fc0ad72b36db 100644 (file)
@@ -26,7 +26,7 @@ from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
 from neutron.api.v2 import attributes
 from neutron.common import constants
 from neutron.common import exceptions as n_exc
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils
 from neutron.db import agents_db
@@ -57,7 +57,7 @@ from neutron.plugins.common import constants as svc_constants
 LOG = logging.getLogger(__name__)
 
 
-class N1kvRpcCallbacks(rpc_compat.RpcCallback,
+class N1kvRpcCallbacks(n_rpc.RpcCallback,
                        dhcp_rpc_base.DhcpRpcCallbackMixin,
                        l3_rpc_base.L3RpcCallbackMixin):
 
@@ -124,7 +124,7 @@ class N1kvNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
         # RPC support
         self.service_topics = {svc_constants.CORE: topics.PLUGIN,
                                svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN}
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.endpoints = [N1kvRpcCallbacks(), agents_db.AgentExtRpcCallback()]
         for svc_topic in self.service_topics.values():
             self.conn.create_consumer(svc_topic, self.endpoints, fanout=False)
index 471e37631c837e4cc174a0da528a525b910a194d..0a06a43a67b007187946bfbd2c6995cbcfe8a451 100644 (file)
@@ -31,7 +31,7 @@ from neutron.agent import rpc as agent_rpc
 from neutron.agent import securitygroups_rpc as sg_rpc
 from neutron.common import config as common_config
 from neutron.common import constants as n_const
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron import context
 from neutron.openstack.common import log as logging
@@ -79,7 +79,7 @@ CONF.register_opts(agent_opts, "AGENT")
 config.register_agent_state_opts_helper(cfg.CONF)
 
 
-class HyperVSecurityAgent(rpc_compat.RpcCallback,
+class HyperVSecurityAgent(n_rpc.RpcCallback,
                           sg_rpc.SecurityGroupAgentRpcMixin):
     # Set RPC API version to 1.1 by default.
     RPC_API_VERSION = '1.1'
@@ -103,7 +103,7 @@ class HyperVSecurityAgent(rpc_compat.RpcCallback,
                                                      consumers)
 
 
-class HyperVSecurityCallbackMixin(rpc_compat.RpcCallback,
+class HyperVSecurityCallbackMixin(n_rpc.RpcCallback,
                                   sg_rpc.SecurityGroupAgentRpcCallbackMixin):
     # Set RPC API version to 1.1 by default.
     RPC_API_VERSION = '1.1'
@@ -118,7 +118,7 @@ class HyperVPluginApi(agent_rpc.PluginApi,
     pass
 
 
-class HyperVNeutronAgent(rpc_compat.RpcCallback):
+class HyperVNeutronAgent(n_rpc.RpcCallback):
     # Set RPC API version to 1.0 by default.
     RPC_API_VERSION = '1.0'
 
index bebb0e9e4c5d84bd0c1f7fb11bd669cd31be63e1..bceab0a221d98bfb6b9a208972ddd018287e0f35 100644 (file)
@@ -14,7 +14,7 @@
 #    under the License.
 # @author: Alessandro Pilotti, Cloudbase Solutions Srl
 
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.openstack.common import log as logging
 from neutron.plugins.hyperv.common import constants
@@ -22,7 +22,7 @@ from neutron.plugins.hyperv.common import constants
 LOG = logging.getLogger(__name__)
 
 
-class AgentNotifierApi(rpc_compat.RpcProxy):
+class AgentNotifierApi(n_rpc.RpcProxy):
     '''Agent side of the openvswitch rpc API.
 
     API version history:
index 51c7eabdba4833f0bdd08608e39efa82cb06214f..765f65bbd42bf09fad93be38eb729671948f946c 100644 (file)
@@ -18,7 +18,7 @@ from oslo.config import cfg
 
 from neutron.api.v2 import attributes
 from neutron.common import exceptions as n_exc
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db import agents_db
 from neutron.db import db_base_plugin_v2
@@ -185,7 +185,7 @@ class HyperVNeutronPlugin(agents_db.AgentDbMixin,
         # RPC support
         self.service_topics = {svc_constants.CORE: topics.PLUGIN,
                                svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN}
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.notifier = agent_notifier_api.AgentNotifierApi(
             topics.AGENT)
         self.endpoints = [rpc_callbacks.HyperVRpcCallbacks(self.notifier),
index 086069f3a5e0b3135f823a0810a36dedd7cb1816..8f71828e6543497b45932d2fcd255b9742dfcde9 100644 (file)
@@ -15,7 +15,7 @@
 # @author: Alessandro Pilotti, Cloudbase Solutions Srl
 
 from neutron.common import constants as q_const
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.db import dhcp_rpc_base
 from neutron.db import l3_rpc_base
 from neutron.openstack.common import log as logging
@@ -26,7 +26,7 @@ LOG = logging.getLogger(__name__)
 
 
 class HyperVRpcCallbacks(
-        rpc_compat.RpcCallback,
+        n_rpc.RpcCallback,
         dhcp_rpc_base.DhcpRpcCallbackMixin,
         l3_rpc_base.L3RpcCallbackMixin):
 
index e1c8d3ed71c324f3b03a626d76fb3a18c278cacf..b3203d4ae9751ed14024dd61e50f9cd6efabefe1 100644 (file)
@@ -31,7 +31,7 @@ from neutron.agent.linux import ovs_lib
 from neutron.agent import rpc as agent_rpc
 from neutron.common import config as common_config
 from neutron.common import constants as n_const
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils as n_utils
 from neutron import context
@@ -52,7 +52,7 @@ class SdnvePluginApi(agent_rpc.PluginApi):
                          topic=self.topic)
 
 
-class SdnveNeutronAgent(rpc_compat.RpcCallback):
+class SdnveNeutronAgent(n_rpc.RpcCallback):
 
     RPC_API_VERSION = '1.1'
 
index cf127f0014604d169c73126e2a879e277e7995c1..2097122792f6dff0000278102faf1ed805faf46e 100644 (file)
@@ -23,7 +23,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_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db import agents_db
 from neutron.db import db_base_plugin_v2
@@ -56,7 +56,7 @@ class SdnveRpcCallbacks():
         return info
 
 
-class AgentNotifierApi(rpc_compat.RpcProxy):
+class AgentNotifierApi(n_rpc.RpcProxy):
     '''Agent side of the SDN-VE rpc API.'''
 
     BASE_RPC_API_VERSION = '1.0'
@@ -131,7 +131,7 @@ class SdnvePluginV2(db_base_plugin_v2.NeutronDbPluginV2,
     def setup_rpc(self):
         # RPC support
         self.topic = topics.PLUGIN
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.notifier = AgentNotifierApi(topics.AGENT)
         self.endpoints = [SdnveRpcCallbacks(self.notifier),
                           agents_db.AgentExtRpcCallback()]
index f468bc0fece2dd605931c79502ef33b794470d69..bef54d3c72a7288894baae4886a9b7fb59eb34e7 100755 (executable)
@@ -37,7 +37,7 @@ from neutron.agent import securitygroups_rpc as sg_rpc
 from neutron.common import config as common_config
 from neutron.common import constants
 from neutron.common import exceptions
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils as q_utils
 from neutron import context
@@ -644,7 +644,7 @@ class LinuxBridgeManager:
                 self.remove_fdb_bridge_entry(mac, agent_ip, interface)
 
 
-class LinuxBridgeRpcCallbacks(rpc_compat.RpcCallback,
+class LinuxBridgeRpcCallbacks(n_rpc.RpcCallback,
                               sg_rpc.SecurityGroupAgentRpcCallbackMixin,
                               l2pop_rpc.L2populationRpcCallBackMixin):
 
index 412275d24eb96e83570182d205cbdf2b6586801f..b1d828dfc91ff15d799a17124a577c1373e8f6d1 100644 (file)
@@ -23,7 +23,7 @@ from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
 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_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils
 from neutron.db import agents_db
@@ -53,7 +53,7 @@ from neutron.plugins.linuxbridge.db import l2network_db_v2 as db
 LOG = logging.getLogger(__name__)
 
 
-class LinuxBridgeRpcCallbacks(rpc_compat.RpcCallback,
+class LinuxBridgeRpcCallbacks(n_rpc.RpcCallback,
                               dhcp_rpc_base.DhcpRpcCallbackMixin,
                               l3_rpc_base.L3RpcCallbackMixin,
                               sg_db_rpc.SecurityGroupServerRpcCallbackMixin
@@ -152,7 +152,7 @@ class LinuxBridgeRpcCallbacks(rpc_compat.RpcCallback,
             LOG.debug(_("%s can not be found in database"), device)
 
 
-class AgentNotifierApi(rpc_compat.RpcProxy,
+class AgentNotifierApi(n_rpc.RpcProxy,
                        sg_rpc.SecurityGroupAgentRpcApiMixin):
     '''Agent side of the linux bridge rpc API.
 
@@ -272,7 +272,7 @@ class LinuxBridgePluginV2(db_base_plugin_v2.NeutronDbPluginV2,
         # RPC support
         self.service_topics = {svc_constants.CORE: topics.PLUGIN,
                                svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN}
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.endpoints = [LinuxBridgeRpcCallbacks(),
                           agents_db.AgentExtRpcCallback()]
         for svc_topic in self.service_topics.values():
index 0ca7eadc719b80e5051a8cd178079a45433c3bd2..3de1194ffe9788a6b7e5200d783cac8c096778e2 100644 (file)
@@ -27,7 +27,7 @@ from sqlalchemy.orm import exc as sa_exc
 from neutron.api.v2 import attributes
 from neutron.common import constants
 from neutron.common import exceptions as n_exc
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db import agents_db
 from neutron.db import agentschedulers_db
@@ -174,7 +174,7 @@ def _check_resource_exists(func, id, name, raise_exc=False):
             raise MidonetPluginException(msg=exc)
 
 
-class MidoRpcCallbacks(rpc_compat.RpcCallback,
+class MidoRpcCallbacks(n_rpc.RpcCallback,
                        dhcp_rpc_base.DhcpRpcCallbackMixin):
     RPC_API_VERSION = '1.1'
 
@@ -369,7 +369,7 @@ class MidonetPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
     def setup_rpc(self):
         # RPC support
         self.topic = topics.PLUGIN
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.endpoints = [MidoRpcCallbacks(),
                           agents_db.AgentExtRpcCallback()]
         self.conn.create_consumer(self.topic, self.endpoints,
index b4f171a27f67a8154a9f2fd2b81341a4575b6588..7be7b8a6640bb12806e2eedc2a67e865bb4ecb10 100644 (file)
@@ -17,7 +17,7 @@
 # @author: Francois Eleouet, Orange
 # @author: Mathieu Rohon, Orange
 
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.openstack.common import log as logging
 
@@ -25,7 +25,7 @@ from neutron.openstack.common import log as logging
 LOG = logging.getLogger(__name__)
 
 
-class L2populationAgentNotifyAPI(rpc_compat.RpcProxy):
+class L2populationAgentNotifyAPI(n_rpc.RpcProxy):
     BASE_RPC_API_VERSION = '1.0'
 
     def __init__(self, topic=topics.AGENT):
index a324637c5f89808c56250fe8933a2bf5820262e3..9232b4b40a89c312842479575246965b24735bc4 100644 (file)
@@ -23,7 +23,7 @@ from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
 from neutron.api.v2 import attributes
 from neutron.common import constants as const
 from neutron.common import exceptions as exc
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db import agents_db
 from neutron.db import agentschedulers_db
@@ -130,7 +130,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
         self.endpoints = [rpc.RpcCallbacks(self.notifier, self.type_manager),
                           agents_db.AgentExtRpcCallback()]
         self.topic = topics.PLUGIN
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.conn.create_consumer(self.topic, self.endpoints,
                                   fanout=False)
         return self.conn.consume_in_threads()
index c744147c687f6c8fd228a7b6a378f5248dec9c72..d58751c94d24a934bb899ee9bdb5f2d8805a511e 100644 (file)
@@ -17,7 +17,7 @@ from oslo import messaging
 
 from neutron.agent import securitygroups_rpc as sg_rpc
 from neutron.common import constants as q_const
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db import api as db_api
 from neutron.db import dhcp_rpc_base
@@ -46,7 +46,7 @@ class RpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin,
     #   1.0 Initial version (from openvswitch/linuxbridge)
     #   1.1 Support Security Group RPC
 
-    # FIXME(ihrachys): we can't use rpc_compat.RpcCallback here due to
+    # FIXME(ihrachys): we can't use n_rpc.RpcCallback here due to
     # inheritance problems
     target = messaging.Target(version=RPC_API_VERSION)
 
@@ -198,7 +198,7 @@ class RpcCallbacks(dhcp_rpc_base.DhcpRpcCallbackMixin,
                                   q_const.PORT_STATUS_ACTIVE)
 
 
-class AgentNotifierApi(rpc_compat.RpcProxy,
+class AgentNotifierApi(n_rpc.RpcProxy,
                        sg_rpc.SecurityGroupAgentRpcApiMixin,
                        type_tunnel.TunnelAgentRpcApiMixin):
     """Agent side of the openvswitch rpc API.
index 3cdc41bab0e59891242535d634204247a75c3f90..ecb134cf033b965380ccb0e7f156a123d8f26bc2 100644 (file)
@@ -27,7 +27,7 @@ from neutron.agent import rpc as agent_rpc
 from neutron.agent import securitygroups_rpc as sg_rpc
 from neutron.common import config as common_config
 from neutron.common import constants as q_constants
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils as q_utils
 from neutron import context
@@ -143,7 +143,7 @@ class EswitchManager(object):
         self.network_map[network_id] = data
 
 
-class MlnxEswitchRpcCallbacks(rpc_compat.RpcCallback,
+class MlnxEswitchRpcCallbacks(n_rpc.RpcCallback,
                               sg_rpc.SecurityGroupAgentRpcCallbackMixin):
 
     # Set RPC API version to 1.0 by default.
@@ -203,7 +203,7 @@ class MlnxEswitchRpcCallbacks(rpc_compat.RpcCallback,
                         port['mac_address'],
                         self.agent.agent_id,
                         cfg.CONF.host)
-            except rpc_compat.MessagingTimeout:
+            except n_rpc.MessagingTimeout:
                 LOG.error(_("RPC timeout while updating port %s"), port['id'])
         else:
             LOG.debug(_("No port %s defined on agent."), port['id'])
index 4839f8f53a9dc5e8def4ae08b54a22e3efcde660..b17ad7e6b75a44730d2e120686f4489c33310578 100644 (file)
 from oslo.config import cfg
 
 from neutron.agent import securitygroups_rpc as sg_rpc
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
 
 
-class AgentNotifierApi(rpc_compat.RpcProxy,
+class AgentNotifierApi(n_rpc.RpcProxy,
                        sg_rpc.SecurityGroupAgentRpcApiMixin):
     """Agent side of the Embedded Switch RPC API.
 
index 41c0e98041b51aacaafa5bddb5df011a0c0a49c7..79af9225045005dc3853649037b38c1883652608 100644 (file)
@@ -23,7 +23,7 @@ from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
 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_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils
 from neutron.db import agents_db
@@ -118,7 +118,7 @@ class MellanoxEswitchPlugin(db_base_plugin_v2.NeutronDbPluginV2,
         # RPC support
         self.service_topics = {svc_constants.CORE: topics.PLUGIN,
                                svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN}
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.endpoints = [rpc_callbacks.MlnxRpcCallbacks(),
                           agents_db.AgentExtRpcCallback()]
         for svc_topic in self.service_topics.values():
index e7f1f30b6277380d575e278f3de50136fb760760..279ba57a8085aaa15fe97253ba9908a13a13f277 100644 (file)
@@ -15,7 +15,7 @@
 from oslo.config import cfg
 
 from neutron.common import constants as q_const
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.db import api as db_api
 from neutron.db import dhcp_rpc_base
 from neutron.db import l3_rpc_base
@@ -26,7 +26,7 @@ from neutron.plugins.mlnx.db import mlnx_db_v2 as db
 LOG = logging.getLogger(__name__)
 
 
-class MlnxRpcCallbacks(rpc_compat.RpcCallback,
+class MlnxRpcCallbacks(n_rpc.RpcCallback,
                        dhcp_rpc_base.DhcpRpcCallbackMixin,
                        l3_rpc_base.L3RpcCallbackMixin,
                        sg_db_rpc.SecurityGroupServerRpcCallbackMixin):
index 6ab5f82b4eede1db0218a2f5d18e114160dc5b51..241503afc0ab64e194b695dd90c8874c4911921d 100755 (executable)
@@ -32,7 +32,7 @@ from neutron.agent import rpc as agent_rpc
 from neutron.agent import securitygroups_rpc as sg_rpc
 from neutron.common import config as common_config
 from neutron.common import constants as q_const
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron import context as q_context
 from neutron.extensions import securitygroup as ext_sg
@@ -62,7 +62,7 @@ class NECPluginApi(agent_rpc.PluginApi):
                                 port_removed=port_removed))
 
 
-class NECAgentRpcCallback(rpc_compat.RpcCallback):
+class NECAgentRpcCallback(n_rpc.RpcCallback):
 
     RPC_API_VERSION = '1.0'
 
@@ -84,7 +84,7 @@ class NECAgentRpcCallback(rpc_compat.RpcCallback):
             self.sg_agent.refresh_firewall()
 
 
-class SecurityGroupServerRpcApi(rpc_compat.RpcProxy,
+class SecurityGroupServerRpcApi(n_rpc.RpcProxy,
                                 sg_rpc.SecurityGroupServerRpcApiMixin):
 
     def __init__(self, topic):
@@ -93,7 +93,7 @@ class SecurityGroupServerRpcApi(rpc_compat.RpcProxy,
 
 
 class SecurityGroupAgentRpcCallback(
-    rpc_compat.RpcCallback,
+    n_rpc.RpcCallback,
     sg_rpc.SecurityGroupAgentRpcCallbackMixin):
 
     RPC_API_VERSION = sg_rpc.SG_RPC_VERSION
index 2c55c589824dc26a3b7db7f81e5e541a4b7227e5..fbeebd7a1ae0e5155aebbeb7391cf902c48cb0cc 100644 (file)
@@ -20,7 +20,7 @@ from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
 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_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db import agents_db
 from neutron.db import agentschedulers_db
@@ -133,7 +133,7 @@ class NECPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
     def setup_rpc(self):
         self.service_topics = {svc_constants.CORE: topics.PLUGIN,
                                svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN}
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.notifier = NECPluginV2AgentNotifierApi(topics.AGENT)
         self.agent_notifiers[const.AGENT_TYPE_DHCP] = (
             dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
@@ -657,7 +657,7 @@ class NECPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
         self.notify_security_groups_member_updated(context, port)
 
 
-class NECPluginV2AgentNotifierApi(rpc_compat.RpcProxy,
+class NECPluginV2AgentNotifierApi(n_rpc.RpcProxy,
                                   sg_rpc.SecurityGroupAgentRpcApiMixin):
     '''RPC API for NEC plugin agent.'''
 
@@ -676,20 +676,20 @@ class NECPluginV2AgentNotifierApi(rpc_compat.RpcProxy,
                          topic=self.topic_port_update)
 
 
-class DhcpRpcCallback(rpc_compat.RpcCallback,
+class DhcpRpcCallback(n_rpc.RpcCallback,
                       dhcp_rpc_base.DhcpRpcCallbackMixin):
     # DhcpPluginApi BASE_RPC_API_VERSION
     RPC_API_VERSION = '1.1'
 
 
-class L3RpcCallback(rpc_compat.RpcCallback, l3_rpc_base.L3RpcCallbackMixin):
+class L3RpcCallback(n_rpc.RpcCallback, l3_rpc_base.L3RpcCallbackMixin):
     # 1.0  L3PluginApi BASE_RPC_API_VERSION
     # 1.1  Support update_floatingip_statuses
     RPC_API_VERSION = '1.1'
 
 
 class SecurityGroupServerRpcCallback(
-    rpc_compat.RpcCallback,
+    n_rpc.RpcCallback,
     sg_db_rpc.SecurityGroupServerRpcCallbackMixin):
 
     RPC_API_VERSION = sg_rpc.SG_RPC_VERSION
@@ -705,7 +705,7 @@ class SecurityGroupServerRpcCallback(
         return port
 
 
-class NECPluginV2RPCCallbacks(rpc_compat.RpcCallback):
+class NECPluginV2RPCCallbacks(n_rpc.RpcCallback):
 
     RPC_API_VERSION = '1.0'
 
index 6e6cd84d7f7f8056f05a272be0ad7261eaac78c9..a38e5846182e4c59f6fa37e942ec57565f78e430 100644 (file)
@@ -33,7 +33,7 @@ from neutron.agent.linux import utils
 from neutron.agent import rpc as agent_rpc
 from neutron.agent import securitygroups_rpc as sg_rpc
 from neutron.common import constants as n_const
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils as n_utils
 from neutron import context
@@ -159,7 +159,7 @@ class OFANeutronAgentRyuApp(app_manager.RyuApp):
         agent.daemon_loop()
 
 
-class OFANeutronAgent(rpc_compat.RpcCallback,
+class OFANeutronAgent(n_rpc.RpcCallback,
                       sg_rpc.SecurityGroupAgentRpcCallbackMixin):
     """A agent for OpenFlow Agent ML2 mechanism driver.
 
index 377cdda1e99a636214e506701ecda8f0184f5668..674cc197aad2320290641e297dd565cac6cef574 100644 (file)
@@ -27,7 +27,7 @@ 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 common_config
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron import context as n_context
 from neutron.extensions import securitygroup as ext_sg
@@ -37,7 +37,7 @@ from neutron.plugins.oneconvergence.lib import config
 LOG = logging.getLogger(__name__)
 
 
-class NVSDAgentRpcCallback(rpc_compat.RpcCallback):
+class NVSDAgentRpcCallback(n_rpc.RpcCallback):
 
     RPC_API_VERSION = '1.0'
 
@@ -59,7 +59,7 @@ class NVSDAgentRpcCallback(rpc_compat.RpcCallback):
             self.sg_agent.refresh_firewall()
 
 
-class SecurityGroupServerRpcApi(rpc_compat.RpcProxy,
+class SecurityGroupServerRpcApi(n_rpc.RpcProxy,
                                 sg_rpc.SecurityGroupServerRpcApiMixin):
     def __init__(self, topic):
         super(SecurityGroupServerRpcApi, self).__init__(
@@ -67,7 +67,7 @@ class SecurityGroupServerRpcApi(rpc_compat.RpcProxy,
 
 
 class SecurityGroupAgentRpcCallback(
-    rpc_compat.RpcCallback,
+    n_rpc.RpcCallback,
     sg_rpc.SecurityGroupAgentRpcCallbackMixin):
 
     RPC_API_VERSION = sg_rpc.SG_RPC_VERSION
@@ -88,7 +88,7 @@ class SecurityGroupAgentRpc(sg_rpc.SecurityGroupAgentRpcMixin):
         self.init_firewall()
 
 
-class NVSDNeutronAgent(rpc_compat.RpcCallback):
+class NVSDNeutronAgent(n_rpc.RpcCallback):
     # history
     #   1.0 Initial version
     #   1.1 Support Security Group RPC
index 257ab5494e24049e5930692e44ff9560986cf4ce..1456007bdf3331db5b8d40609ae98f9194c443a8 100644 (file)
@@ -23,7 +23,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 exceptions as nexception
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db import agents_db
 from neutron.db import agentschedulers_db
@@ -51,7 +51,7 @@ LOG = logging.getLogger(__name__)
 IPv6 = 6
 
 
-class NVSDPluginRpcCallbacks(rpc_compat.RpcCallback,
+class NVSDPluginRpcCallbacks(n_rpc.RpcCallback,
                              dhcp_rpc_base.DhcpRpcCallbackMixin,
                              l3_rpc_base.L3RpcCallbackMixin,
                              sg_db_rpc.SecurityGroupServerRpcCallbackMixin):
@@ -66,7 +66,7 @@ class NVSDPluginRpcCallbacks(rpc_compat.RpcCallback,
         return port
 
 
-class NVSDPluginV2AgentNotifierApi(rpc_compat.RpcProxy,
+class NVSDPluginV2AgentNotifierApi(n_rpc.RpcProxy,
                                    sg_rpc.SecurityGroupAgentRpcApiMixin):
 
     BASE_RPC_API_VERSION = '1.0'
@@ -153,7 +153,7 @@ class OneConvergencePluginV2(db_base_plugin_v2.NeutronDbPluginV2,
         # RPC support
         self.service_topics = {svc_constants.CORE: topics.PLUGIN,
                                svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN}
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.notifier = NVSDPluginV2AgentNotifierApi(topics.AGENT)
         self.agent_notifiers[q_const.AGENT_TYPE_DHCP] = (
             dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
index 46b9bf4f086736ea4d13e66a102f18980191e433..a45c59a938ae3baa5fbaca6d6d671038c554d919 100644 (file)
@@ -35,7 +35,7 @@ from neutron.agent import rpc as agent_rpc
 from neutron.agent import securitygroups_rpc as sg_rpc
 from neutron.common import config as common_config
 from neutron.common import constants as q_const
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils as q_utils
 from neutron import context
@@ -86,7 +86,7 @@ class OVSSecurityGroupAgent(sg_rpc.SecurityGroupAgentRpcMixin):
         self.init_firewall(defer_refresh_firewall=True)
 
 
-class OVSNeutronAgent(rpc_compat.RpcCallback,
+class OVSNeutronAgent(n_rpc.RpcCallback,
                       sg_rpc.SecurityGroupAgentRpcCallbackMixin,
                       l2population_rpc.L2populationRpcCallBackMixin):
     '''Implements OVS-based tunneling, VLANs and flat networks.
index 31698a3df5467ab2ff76b7caa871ea5bbb3378a6..ebfeacf10f0ad18b7ab325befa65829b7ada713a 100644 (file)
@@ -23,7 +23,7 @@ from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
 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_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.common import utils
 from neutron.db import agents_db
@@ -57,7 +57,7 @@ from neutron.plugins.openvswitch import ovs_db_v2
 LOG = logging.getLogger(__name__)
 
 
-class OVSRpcCallbacks(rpc_compat.RpcCallback,
+class OVSRpcCallbacks(n_rpc.RpcCallback,
                       dhcp_rpc_base.DhcpRpcCallbackMixin,
                       l3_rpc_base.L3RpcCallbackMixin,
                       sg_db_rpc.SecurityGroupServerRpcCallbackMixin):
@@ -173,7 +173,7 @@ class OVSRpcCallbacks(rpc_compat.RpcCallback,
         return entry
 
 
-class AgentNotifierApi(rpc_compat.RpcProxy,
+class AgentNotifierApi(n_rpc.RpcProxy,
                        sg_rpc.SecurityGroupAgentRpcApiMixin):
     '''Agent side of the openvswitch rpc API.
 
@@ -325,7 +325,7 @@ class OVSNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
         # RPC support
         self.service_topics = {svc_constants.CORE: topics.PLUGIN,
                                svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN}
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.notifier = AgentNotifierApi(topics.AGENT)
         self.agent_notifiers[q_const.AGENT_TYPE_DHCP] = (
             dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
index d1fac31852527966577d90b830b20ce738b9b3ed..18db0f91903071e8a29bbcb7ddfe389ff1f608fa 100755 (executable)
@@ -37,7 +37,7 @@ from neutron.agent import rpc as agent_rpc
 from neutron.agent import securitygroups_rpc as sg_rpc
 from neutron.common import config as common_config
 from neutron.common import exceptions as n_exc
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron import context as q_context
 from neutron.extensions import securitygroup as ext_sg
@@ -180,7 +180,7 @@ class RyuSecurityGroupAgent(sg_rpc.SecurityGroupAgentRpcMixin):
         self.init_firewall()
 
 
-class OVSNeutronOFPRyuAgent(rpc_compat.RpcCallback,
+class OVSNeutronOFPRyuAgent(n_rpc.RpcCallback,
                             sg_rpc.SecurityGroupAgentRpcCallbackMixin):
 
     RPC_API_VERSION = '1.1'
index fd6426c45b27a14b9a9166dddd587f0901d7888e..34ace9d7d02f60a35d14d920a2783381e752458e 100644 (file)
@@ -22,7 +22,7 @@ from ryu.app import rest_nw_id
 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_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db import api as db
 from neutron.db import db_base_plugin_v2
@@ -45,7 +45,7 @@ from neutron.plugins.ryu.db import api_v2 as db_api_v2
 LOG = logging.getLogger(__name__)
 
 
-class RyuRpcCallbacks(rpc_compat.RpcCallback,
+class RyuRpcCallbacks(n_rpc.RpcCallback,
                       dhcp_rpc_base.DhcpRpcCallbackMixin,
                       l3_rpc_base.L3RpcCallbackMixin,
                       sg_db_rpc.SecurityGroupServerRpcCallbackMixin):
@@ -68,7 +68,7 @@ class RyuRpcCallbacks(rpc_compat.RpcCallback,
         return port
 
 
-class AgentNotifierApi(rpc_compat.RpcProxy,
+class AgentNotifierApi(n_rpc.RpcProxy,
                        sg_rpc.SecurityGroupAgentRpcApiMixin):
 
     BASE_RPC_API_VERSION = '1.0'
@@ -137,7 +137,7 @@ class RyuNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
     def _setup_rpc(self):
         self.service_topics = {svc_constants.CORE: topics.PLUGIN,
                                svc_constants.L3_ROUTER_NAT: topics.L3PLUGIN}
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.notifier = AgentNotifierApi(topics.AGENT)
         self.endpoints = [RyuRpcCallbacks(self.ofp_api_host)]
         for svc_topic in self.service_topics.values():
index af19bc601e6db313da1ab695af6fef1716d358d6..e4e06134bcdc84e8458192422a4a288f34e21fc1 100644 (file)
@@ -22,7 +22,7 @@ from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
 from neutron.api.v2 import attributes
 from neutron.common import constants as const
 from neutron.common import exceptions as ntn_exc
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.db import db_base_plugin_v2
 from neutron.db import dhcp_rpc_base
 from neutron.db import l3_db
@@ -40,7 +40,7 @@ METADATA_GATEWAY_IP = '169.254.169.253'
 METADATA_DHCP_ROUTE = '169.254.169.254/32'
 
 
-class NSXRpcCallbacks(rpc_compat.RpcCallback,
+class NSXRpcCallbacks(n_rpc.RpcCallback,
                       dhcp_rpc_base.DhcpRpcCallbackMixin):
 
     RPC_API_VERSION = '1.1'
index 0ce2112f60aad0f5ba3cd76ed0fa8316c9d568fc..6312700b789a541631f491c7a0102e6fafea9270 100644 (file)
@@ -19,7 +19,7 @@ from oslo.config import cfg
 
 from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
 from neutron.common import constants as const
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db import agents_db
 from neutron.openstack.common import importutils
@@ -70,7 +70,7 @@ class DhcpMetadataAccess(object):
 
     def _setup_rpc_dhcp_metadata(self, notifier=None):
         self.topic = topics.PLUGIN
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.endpoints = [nsx_rpc.NSXRpcCallbacks(),
                           agents_db.AgentExtRpcCallback()]
         self.conn.create_consumer(self.topic, self.endpoints, fanout=False)
index c26182bc5db19f67d6be2636bcf0c8e4f06b126c..cf357d16fa351ee33266b3477ed547c3f01eb5fe 100644 (file)
@@ -22,7 +22,7 @@ from oslo.config import cfg
 from oslo.messaging import server as rpc_server
 
 from neutron.common import config
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron import context
 from neutron.db import api as session
 from neutron import manager
@@ -180,7 +180,7 @@ def _run_wsgi(app_name):
     return server
 
 
-class Service(rpc_compat.Service):
+class Service(n_rpc.Service):
     """Service object for binaries running on hosts.
 
     A service takes a manager and enables rpc by listening to queues based
index 9bd917d4c24f1ecbb2c64b93600967f8ab5ca8e2..9dcc44ae08bbfec6388b8c463f8d30a91b8b8b1e 100644 (file)
@@ -19,7 +19,7 @@
 
 from oslo.config import cfg
 
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.openstack.common import log as logging
 
 LOG = logging.getLogger(__name__)
@@ -37,7 +37,7 @@ FWaaSOpts = [
 cfg.CONF.register_opts(FWaaSOpts, 'fwaas')
 
 
-class FWaaSPluginApiMixin(rpc_compat.RpcProxy):
+class FWaaSPluginApiMixin(n_rpc.RpcProxy):
     """Agent side of the FWaaS agent to FWaaS Plugin RPC API."""
 
     RPC_API_VERSION = '1.0'
index a63863e996c1b63b41ebffb8c0f6228e2368df96..27a54393064490f8f6656be1ee059f952eec6140 100644 (file)
@@ -18,7 +18,7 @@
 from oslo.config import cfg
 
 from neutron.common import exceptions as n_exception
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron import context as neutron_context
 from neutron.db import api as qdbapi
@@ -31,7 +31,7 @@ from neutron.plugins.common import constants as const
 LOG = logging.getLogger(__name__)
 
 
-class FirewallCallbacks(rpc_compat.RpcCallback):
+class FirewallCallbacks(n_rpc.RpcCallback):
     RPC_API_VERSION = '1.0'
 
     def __init__(self, plugin):
@@ -101,7 +101,7 @@ class FirewallCallbacks(rpc_compat.RpcCallback):
         return fw_tenant_list
 
 
-class FirewallAgentApi(rpc_compat.RpcProxy):
+class FirewallAgentApi(n_rpc.RpcProxy):
     """Plugin side of plugin to agent RPC API."""
 
     API_VERSION = '1.0'
@@ -162,7 +162,7 @@ class FirewallPlugin(firewall_db.Firewall_db_mixin):
 
         self.endpoints = [FirewallCallbacks(self)]
 
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.conn.create_consumer(
             topics.FIREWALL_PLUGIN, self.endpoints, fanout=False)
         self.conn.consume_in_threads()
index 29c638ddc43e2aeb8482decd7bf43e77f8fe0cc8..c018a3c4e6dfbde0dc3bd9c6bcc844270718989f 100644 (file)
@@ -19,7 +19,7 @@ from oslo.config import cfg
 
 from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
 from neutron.common import constants as q_const
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db import api as qdbapi
 from neutron.db import db_base_plugin_v2
@@ -32,7 +32,7 @@ from neutron.openstack.common import importutils
 from neutron.plugins.common import constants
 
 
-class L3RouterPluginRpcCallbacks(rpc_compat.RpcCallback,
+class L3RouterPluginRpcCallbacks(n_rpc.RpcCallback,
                                  l3_rpc_base.L3RpcCallbackMixin):
 
     RPC_API_VERSION = '1.1'
@@ -63,7 +63,7 @@ class L3RouterPlugin(db_base_plugin_v2.CommonDbMixin,
     def setup_rpc(self):
         # RPC support
         self.topic = topics.L3PLUGIN
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.agent_notifiers.update(
             {q_const.AGENT_TYPE_L3: l3_rpc_agent_api.L3AgentNotifyAPI()})
         self.endpoints = [L3RouterPluginRpcCallbacks()]
index 7c7a13c0838cf247b4d8394418220f36c36a0e2c..0434c688c8fa01737986d9f98380d3a13bf6d174 100644 (file)
@@ -24,7 +24,7 @@ from oslo.config import cfg
 from neutron.agent.common import config
 from neutron.agent.linux import interface
 from neutron.common import config as common_config
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.openstack.common import service
 from neutron.services.loadbalancer.agent import agent_manager as manager
@@ -38,7 +38,7 @@ OPTS = [
 ]
 
 
-class LbaasAgentService(rpc_compat.Service):
+class LbaasAgentService(n_rpc.Service):
     def start(self):
         super(LbaasAgentService, self).start()
         self.tg.add_timer(
index a2d981a6fe7d08caff63afeac4dbb260e970d33f..eb2a165c552b10e07d11c62e6a9119508e59d9b4 100644 (file)
 #
 # @author: Mark McClain, DreamHost
 
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 
 
-class LbaasAgentApi(rpc_compat.RpcProxy):
+class LbaasAgentApi(n_rpc.RpcProxy):
     """Agent side of the Agent to Plugin RPC API."""
 
     API_VERSION = '2.0'
index 74d7c717d774e7898b8bcd854d03245bdf9daae5..52da4f5eee7576fe98374dfffb26ef1c974ed09e 100644 (file)
@@ -19,7 +19,7 @@ from oslo.config import cfg
 from neutron.agent import rpc as agent_rpc
 from neutron.common import constants as n_const
 from neutron.common import exceptions as n_exc
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron import context
 from neutron.openstack.common import importutils
@@ -45,7 +45,7 @@ class DeviceNotFoundOnAgent(n_exc.NotFound):
     msg = _('Unknown device with pool_id %(pool_id)s')
 
 
-class LbaasAgentManager(rpc_compat.RpcCallback, periodic_task.PeriodicTasks):
+class LbaasAgentManager(n_rpc.RpcCallback, periodic_task.PeriodicTasks):
 
     RPC_API_VERSION = '2.0'
     # history
index ad87041914b142d899b3eaaa3b1c48c229eaa95e..0f8e036d11244b07c78ef25918cca57761375189 100644 (file)
@@ -20,7 +20,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_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db import agents_db
 from neutron.db.loadbalancer import loadbalancer_db
@@ -49,7 +49,7 @@ class DriverNotSpecified(n_exc.NeutronException):
                 "in plugin driver.")
 
 
-class LoadBalancerCallbacks(rpc_compat.RpcCallback):
+class LoadBalancerCallbacks(n_rpc.RpcCallback):
 
     RPC_API_VERSION = '2.0'
     # history
@@ -232,7 +232,7 @@ class LoadBalancerCallbacks(rpc_compat.RpcCallback):
         self.plugin.update_pool_stats(context, pool_id, data=stats)
 
 
-class LoadBalancerAgentApi(rpc_compat.RpcProxy):
+class LoadBalancerAgentApi(n_rpc.RpcProxy):
     """Plugin side of plugin to agent RPC API."""
 
     BASE_RPC_API_VERSION = '2.0'
@@ -341,7 +341,7 @@ class AgentDriverBase(abstract_driver.LoadBalancerAbstractDriver):
             LoadBalancerCallbacks(self.plugin),
             agents_db.AgentExtRpcCallback(self.plugin)
         ]
-        self.plugin.conn = rpc_compat.create_connection(new=True)
+        self.plugin.conn = n_rpc.create_connection(new=True)
         self.plugin.conn.create_consumer(
             topics.LOADBALANCER_PLUGIN,
             self.plugin.agent_endpoints,
index 80883f41b377057f125258d6a3ff931739885a4c..2747fe84279367d106dc72116b9386ecce52a000 100644 (file)
@@ -27,7 +27,6 @@ from neutron.agent import rpc as agent_rpc
 from neutron.common import config as common_config
 from neutron.common import constants as constants
 from neutron.common import rpc as n_rpc
-from neutron.common import rpc_compat
 from neutron.common import topics
 from neutron.common import utils
 from neutron import context
@@ -43,7 +42,7 @@ from neutron import service as neutron_service
 LOG = logging.getLogger(__name__)
 
 
-class MeteringPluginRpc(rpc_compat.RpcProxy):
+class MeteringPluginRpc(n_rpc.RpcProxy):
 
     BASE_RPC_API_VERSION = '1.0'
 
index e67dbab60d4c181f00eb6ccb65911720269f5ea0..b2e9215b8eade9043d76a63a0f51dafa96267bf5 100644 (file)
@@ -15,7 +15,7 @@
 # under the License.
 
 from neutron.api.rpc.agentnotifiers import metering_rpc_agent_api
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.db.metering import metering_db
 from neutron.db.metering import metering_rpc
@@ -30,7 +30,7 @@ class MeteringPlugin(metering_db.MeteringDbMixin):
 
         self.endpoints = [metering_rpc.MeteringRpcCallbacks(self)]
 
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.conn.create_consumer(
             topics.METERING_PLUGIN, self.endpoints, fanout=False)
         self.conn.consume_in_threads()
index 7d73735c1cced572169ceccbab7d2e562bd75f3c..33a806d4bfe228cf3b461e3544365fe71338b803 100644 (file)
@@ -24,7 +24,7 @@ from oslo import messaging
 import six
 
 from neutron.common import exceptions
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron import context as ctx
 from neutron.openstack.common import lockutils
 from neutron.openstack.common import log as logging
@@ -150,7 +150,7 @@ def find_available_csrs_from_config(config_files):
     return csrs_found
 
 
-class CiscoCsrIPsecVpnDriverApi(rpc_compat.RpcProxy):
+class CiscoCsrIPsecVpnDriverApi(n_rpc.RpcProxy):
     """RPC API for agent to plugin messaging."""
 
     def get_vpn_services_on_host(self, context, host):
@@ -192,7 +192,7 @@ class CiscoCsrIPsecDriver(device_drivers.DeviceDriver):
 
     def __init__(self, agent, host):
         self.host = host
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         context = ctx.get_admin_context_without_session()
         node_topic = '%s.%s' % (topics.CISCO_IPSEC_AGENT_TOPIC, self.host)
 
index 1c9bad8791708f4d4ad65aa63c6d2b8173b331b7..6d2188fde56dec20b535d0dc8fb4d2586f2f04f4 100644 (file)
@@ -26,7 +26,7 @@ import six
 
 from neutron.agent.linux import ip_lib
 from neutron.agent.linux import utils
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron import context
 from neutron.openstack.common import lockutils
 from neutron.openstack.common import log as logging
@@ -441,7 +441,7 @@ class OpenSwanProcess(BaseSwanProcess):
         self.connection_status = {}
 
 
-class IPsecVpnDriverApi(rpc_compat.RpcProxy):
+class IPsecVpnDriverApi(n_rpc.RpcProxy):
     """IPSecVpnDriver RPC api."""
     IPSEC_PLUGIN_VERSION = '1.0'
 
@@ -494,7 +494,7 @@ class IPsecDriver(device_drivers.DeviceDriver):
         self.conf = self.agent.conf
         self.root_helper = self.agent.root_helper
         self.host = host
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.context = context.get_admin_context_without_session()
         self.topic = topics.IPSEC_AGENT_TOPIC
         node_topic = '%s.%s' % (self.topic, self.host)
index 3bd45670f68a83627497a8333327282f7e1d96e4..17db33384f9a6d25fec81c6bb2f8c054355340e1 100644 (file)
@@ -17,7 +17,7 @@ import abc
 
 import six
 
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron import manager
 from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
@@ -49,7 +49,7 @@ class VpnDriver(object):
         pass
 
 
-class BaseIPsecVpnAgentApi(rpc_compat.RpcProxy):
+class BaseIPsecVpnAgentApi(n_rpc.RpcProxy):
     """Base class for IPSec API to agent."""
 
     def __init__(self, to_agent_topic, topic, default_version):
index ed34f41ff746007f6fe5cd5859b507abe4d808f8..93ce79232f304c7cc7213adef540956f246b1e78 100644 (file)
@@ -16,7 +16,7 @@ import netaddr
 from netaddr import core as net_exc
 
 from neutron.common import exceptions
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.openstack.common import excutils
 from neutron.openstack.common import log as logging
 from neutron.plugins.common import constants
@@ -40,7 +40,7 @@ class CsrValidationFailure(exceptions.BadRequest):
                 "with value '%(value)s'")
 
 
-class CiscoCsrIPsecVpnDriverCallBack(rpc_compat.RpcCallback):
+class CiscoCsrIPsecVpnDriverCallBack(n_rpc.RpcCallback):
 
     """Handler for agent to plugin RPC messaging."""
 
@@ -68,7 +68,7 @@ class CiscoCsrIPsecVpnDriverCallBack(rpc_compat.RpcCallback):
 
 
 class CiscoCsrIPsecVpnAgentApi(service_drivers.BaseIPsecVpnAgentApi,
-                               rpc_compat.RpcCallback):
+                               n_rpc.RpcCallback):
 
     """API and handler for Cisco IPSec plugin to agent RPC messaging."""
 
@@ -86,7 +86,7 @@ class CiscoCsrIPsecVPNDriver(service_drivers.VpnDriver):
     def __init__(self, service_plugin):
         super(CiscoCsrIPsecVPNDriver, self).__init__(service_plugin)
         self.endpoints = [CiscoCsrIPsecVpnDriverCallBack(self)]
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.conn.create_consumer(
             topics.CISCO_IPSEC_DRIVER_TOPIC, self.endpoints, fanout=False)
         self.conn.consume_in_threads()
index 7a7886df7d9a72f8b3b8d198836726c0ad761839..e3c2ee23174f9178481838bd987221b2b479b585 100644 (file)
@@ -14,7 +14,7 @@
 #    under the License.
 import netaddr
 
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.openstack.common import log as logging
 from neutron.services.vpn.common import topics
 from neutron.services.vpn import service_drivers
@@ -26,7 +26,7 @@ IPSEC = 'ipsec'
 BASE_IPSEC_VERSION = '1.0'
 
 
-class IPsecVpnDriverCallBack(rpc_compat.RpcCallback):
+class IPsecVpnDriverCallBack(n_rpc.RpcCallback):
     """Callback for IPSecVpnDriver rpc."""
 
     # history
@@ -53,7 +53,7 @@ class IPsecVpnDriverCallBack(rpc_compat.RpcCallback):
 
 
 class IPsecVpnAgentApi(service_drivers.BaseIPsecVpnAgentApi,
-                       rpc_compat.RpcCallback):
+                       n_rpc.RpcCallback):
     """Agent RPC API for IPsecVPNAgent."""
 
     RPC_API_VERSION = BASE_IPSEC_VERSION
@@ -69,7 +69,7 @@ class IPsecVPNDriver(service_drivers.VpnDriver):
     def __init__(self, service_plugin):
         super(IPsecVPNDriver, self).__init__(service_plugin)
         self.endpoints = [IPsecVpnDriverCallBack(self)]
-        self.conn = rpc_compat.create_connection(new=True)
+        self.conn = n_rpc.create_connection(new=True)
         self.conn.create_consumer(
             topics.IPSEC_DRIVER_TOPIC, self.endpoints, fanout=False)
         self.conn.consume_in_threads()
index dcd12057f1319e747082fc5044dfb65316925b71..253210f7686a740f0aeab7c024849e6d23947694 100644 (file)
@@ -170,7 +170,7 @@ class BaseTestCase(testtools.TestCase):
 
         # don't actually start RPC listeners when testing
         self.useFixture(fixtures.MonkeyPatch(
-            'neutron.common.rpc_compat.Connection.consume_in_threads',
+            'neutron.common.rpc.Connection.consume_in_threads',
             fake_consume_in_threads))
 
         self.useFixture(fixtures.MonkeyPatch(
index ff64b8aecc2619a6e1a52d6a751e923cb1be68c6..e04bd0156b39b5a76cb1e3ba8db715e7e111c8a5 100644 (file)
@@ -21,7 +21,7 @@ Unit Tests for hyperv neutron rpc
 import mock
 
 from neutron.agent import rpc as agent_rpc
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.openstack.common import context
 from neutron.plugins.hyperv import agent_notifier_api as ana
@@ -39,7 +39,7 @@ class rpcHyperVApiTestCase(base.BaseTestCase):
         if rpc_method == 'cast' and method == 'run_instance':
             kwargs['call'] = False
 
-        proxy = rpc_compat.RpcProxy
+        proxy = n_rpc.RpcProxy
         with mock.patch.object(proxy, rpc_method) as rpc_method_mock:
             rpc_method_mock.return_value = expected_retval
             retval = getattr(rpcapi, method)(ctxt, **kwargs)
index 71ccbd707cd2fb124faa7c8623aeb70b7273a3b3..78346c67de2d7ff3b50b418807276d49b595d0bc 100644 (file)
@@ -46,7 +46,7 @@ class rpcApiTestCase(base.BaseTestCase):
                 return expected_retval
 
         self.useFixture(fixtures.MonkeyPatch(
-            'neutron.common.rpc_compat.RpcProxy.' + rpc_method,
+            'neutron.common.rpc.RpcProxy.' + rpc_method,
             _fake_rpc_method))
 
         retval = getattr(rpcapi, method)(ctxt, **kwargs)
index d96be1ccd05c2e4fcc6d4f2230c71fea2a2a1559..4ac07b16535778feba60caed2dcfe292924be8d4 100644 (file)
@@ -117,11 +117,11 @@ class TestL2PopulationRpcTestCase(test_plugin.NeutronDbPluginV2TestCase):
         self.fanout_topic = topics.get_topic_name(topics.AGENT,
                                                   topics.L2POPULATION,
                                                   topics.UPDATE)
-        fanout = ('neutron.common.rpc_compat.RpcProxy.fanout_cast')
+        fanout = ('neutron.common.rpc.RpcProxy.fanout_cast')
         fanout_patch = mock.patch(fanout)
         self.mock_fanout = fanout_patch.start()
 
-        cast = ('neutron.common.rpc_compat.RpcProxy.cast')
+        cast = ('neutron.common.rpc.RpcProxy.cast')
         cast_patch = mock.patch(cast)
         self.mock_cast = cast_patch.start()
 
index af48a74f171c53ad08727c3b195ed08d196fb7a2..c552546ac076f4d852d00cd62cc82fe7f40fa60a 100644 (file)
@@ -20,7 +20,7 @@ Unit Tests for ml2 rpc
 import mock
 
 from neutron.agent import rpc as agent_rpc
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.common import topics
 from neutron.openstack.common import context
 from neutron.plugins.ml2.drivers import type_tunnel
@@ -37,7 +37,7 @@ class RpcApiTestCase(base.BaseTestCase):
         if rpc_method == 'cast' and method == 'run_instance':
             kwargs['call'] = False
 
-        rpc = rpc_compat.RpcProxy
+        rpc = n_rpc.RpcProxy
         with mock.patch.object(rpc, rpc_method) as rpc_method_mock:
             rpc_method_mock.return_value = expected_retval
             retval = getattr(rpcapi, method)(ctxt, **kwargs)
index 27efedc78524b59160bc00c6a0cf3c7c37f7b759..674ba03e9ea62a760b450b4a8f337247128051e5 100644 (file)
@@ -48,7 +48,7 @@ class rpcApiTestCase(base.BaseTestCase):
                 return expected_retval
 
         self.useFixture(fixtures.MonkeyPatch(
-            'neutron.common.rpc_compat.RpcProxy.' + rpc_method,
+            'neutron.common.rpc.RpcProxy.' + rpc_method,
             _fake_rpc_method))
 
         retval = getattr(rpcapi, method)(ctxt, **kwargs)
index 279c76d9e14cbca5457a068fa55d471070b9b283..aca9d8b98cea0523118a625f70d6e777ffc0648d 100644 (file)
@@ -45,7 +45,7 @@ class rpcApiTestCase(base.BaseTestCase):
                 return expected_retval
 
         self.useFixture(fixtures.MonkeyPatch(
-            'neutron.common.rpc_compat.RpcProxy.' + rpc_method,
+            'neutron.common.rpc.RpcProxy.' + rpc_method,
             _fake_rpc_method))
 
         retval = getattr(rpcapi, method)(ctxt, **kwargs)
index 881b248d8543566f60391205b7ddca146eee8701..d8dd60513e2c8e6e78c9371eb4d812bb37b1d379 100644 (file)
@@ -25,7 +25,7 @@ from neutron.tests import base
 class TestLbaasService(base.BaseTestCase):
     def test_start(self):
         with mock.patch.object(
-            agent.rpc_compat.Service, 'start'
+            agent.n_rpc.Service, 'start'
         ) as mock_start:
 
             mgr = mock.Mock()
index 7d7c4c025c3f6365771a43772cce75a248ec47b3..04ac8d2d7d86e16b628c91173c0b0954a5192271 100644 (file)
@@ -83,7 +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.common.rpc_compat.RpcProxy.fanout_cast')
+        fanout = ('neutron.common.rpc.RpcProxy.fanout_cast')
         self.fanout_patch = mock.patch(fanout)
         self.mock_fanout = self.fanout_patch.start()
 
@@ -290,7 +290,7 @@ class TestMeteringPluginL3AgentScheduler(
         self.uuid_patch = mock.patch(uuid, return_value=self.uuid)
         self.mock_uuid = self.uuid_patch.start()
 
-        cast = 'neutron.common.rpc_compat.RpcProxy.cast'
+        cast = 'neutron.common.rpc.RpcProxy.cast'
         self.cast_patch = mock.patch(cast)
         self.mock_cast = self.cast_patch.start()
 
index 3c29e7551f6d68067d37793201cd7649693a659b..b92b77cff0700a690d39a15986219244ae16d7c2 100644 (file)
@@ -399,7 +399,7 @@ class TestCiscoCsrIPsecDeviceDriverSyncStatuses(base.BaseTestCase):
 
     def setUp(self):
         super(TestCiscoCsrIPsecDeviceDriverSyncStatuses, self).setUp()
-        for klass in ['neutron.common.rpc_compat.create_connection',
+        for klass in ['neutron.common.rpc.create_connection',
                       'neutron.context.get_admin_context_without_session',
                       'neutron.openstack.common.'
                       'loopingcall.FixedIntervalLoopingCall']:
index d10ae3d5beb37d0e1a36735c093ae7751c9718cb..bec8b78ce70f5060996457f8488547aa38d2837a 100644 (file)
@@ -45,7 +45,7 @@ class TestIPsecDeviceDriver(base.BaseTestCase):
             'os.makedirs',
             'os.path.isdir',
             'neutron.agent.linux.utils.replace_file',
-            'neutron.common.rpc_compat.create_connection',
+            'neutron.common.rpc.create_connection',
             'neutron.services.vpn.device_drivers.ipsec.'
                 'OpenSwanProcess._gen_config_content',
             'shutil.rmtree',
index f78d8b16c0f729b27f4b169fe54caf59736c3bb6..7a59acedcc84b2ad24690c6301fd4bb577f6237a 100644 (file)
@@ -44,7 +44,7 @@ class TestCiscoIPsecDriverValidation(base.BaseTestCase):
 
     def setUp(self):
         super(TestCiscoIPsecDriverValidation, self).setUp()
-        mock.patch('neutron.common.rpc_compat.create_connection').start()
+        mock.patch('neutron.common.rpc.create_connection').start()
         self.service_plugin = mock.Mock()
         self.driver = ipsec_driver.CiscoCsrIPsecVPNDriver(self.service_plugin)
         self.context = n_ctx.Context('some_user', 'some_tenant')
@@ -284,7 +284,7 @@ class TestCiscoIPsecDriver(base.BaseTestCase):
         super(TestCiscoIPsecDriver, self).setUp()
         dbapi.configure_db()
         self.addCleanup(dbapi.clear_db)
-        mock.patch('neutron.common.rpc_compat.create_connection').start()
+        mock.patch('neutron.common.rpc.create_connection').start()
 
         l3_agent = mock.Mock()
         l3_agent.host = FAKE_HOST
index 713f8d846495e730baa10817cc2c5464b362d3f6..646827e0e28c17c3c2a31a54ce4ed46bc7ee49a2 100644 (file)
@@ -35,7 +35,7 @@ FAKE_HOST = 'fake_host'
 class TestIPsecDriver(base.BaseTestCase):
     def setUp(self):
         super(TestIPsecDriver, self).setUp()
-        mock.patch('neutron.common.rpc_compat.create_connection').start()
+        mock.patch('neutron.common.rpc.create_connection').start()
 
         l3_agent = mock.Mock()
         l3_agent.host = FAKE_HOST
index 4eb48e3e31948d9a2d0edaf4668c7a89edba32f6..c2fa4121191eaf7ed1269579aadf1216613693c7 100644 (file)
@@ -25,7 +25,7 @@ class AgentRPCPluginApi(base.BaseTestCase):
         agent = rpc.PluginApi('fake_topic')
         ctxt = context.RequestContext('fake_user', 'fake_project')
         expect_val = 'foo'
-        with mock.patch('neutron.common.rpc_compat.RpcProxy.call') as rpc_call:
+        with mock.patch('neutron.common.rpc.RpcProxy.call') as rpc_call:
             rpc_call.return_value = expect_val
             func_obj = getattr(agent, method)
             if method == 'tunnel_sync':
@@ -89,7 +89,7 @@ class AgentRPCMethods(base.BaseTestCase):
             mock.call().consume_in_threads()
         ]
 
-        call_to_patch = 'neutron.common.rpc_compat.create_connection'
+        call_to_patch = 'neutron.common.rpc.create_connection'
         with mock.patch(call_to_patch) as create_connection:
             rpc.create_consumers(endpoints, 'foo', [('topic', 'op')])
             create_connection.assert_has_calls(expected)
@@ -105,7 +105,7 @@ class AgentRPCMethods(base.BaseTestCase):
             mock.call().consume_in_threads()
         ]
 
-        call_to_patch = 'neutron.common.rpc_compat.create_connection'
+        call_to_patch = 'neutron.common.rpc.create_connection'
         with mock.patch(call_to_patch) as create_connection:
             rpc.create_consumers(endpoints, 'foo', [('topic', 'op', 'node1')])
             create_connection.assert_has_calls(expected)
index e5bc84095dfc58cc1792abbf5e2ce51510b68ae1..37ac61e0e205dfffe13336c3d8cb06f9310b3498 100644 (file)
@@ -29,7 +29,7 @@ from neutron.agent.linux import interface
 from neutron.common import config as common_config
 from neutron.common import constants as const
 from neutron.common import exceptions
-from neutron.common import rpc_compat
+from neutron.common import rpc as n_rpc
 from neutron.tests import base
 
 
@@ -226,7 +226,7 @@ class TestDhcpAgent(base.BaseTestCase):
 
     def test_call_driver_remote_error_net_not_found(self):
         self._test_call_driver_failure(
-            exc=rpc_compat.RemoteError(exc_type='NetworkNotFound'),
+            exc=n_rpc.RemoteError(exc_type='NetworkNotFound'),
             trace_level='warning')
 
     def test_call_driver_network_not_found(self):
index 49c85e1d80d5c05c50b0601f5d567621b52a947e..6d2e7a970c5a019a87f761f80513fb6d31626a13 100644 (file)
@@ -27,7 +27,7 @@ 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.common import rpc as n_rpc
 from neutron import context
 from neutron.db import securitygroups_rpc_base as sg_db_rpc
 from neutron.extensions import allowedaddresspairs as addr_pair
@@ -1100,7 +1100,7 @@ class SecurityGroupServerRpcApiTestCase(base.BaseTestCase):
              topic='fake_topic')])
 
 
-class FakeSGNotifierAPI(rpc_compat.RpcProxy,
+class FakeSGNotifierAPI(n_rpc.RpcProxy,
                         sg_rpc.SecurityGroupAgentRpcApiMixin):
     pass