remove neutron.common.rpc

The neutron.common.rpc module has been in neutron-lib for awhile now and
neutron is shimmed to use neutron-lib already.
This patch removes neutron.common.rpc and switches the code over to use
neutron-lib's implementation where needed.

NeutronLibImpact

Change-Id: I733f07a8c4a2af071b3467bd710290eee11a4f4c
changes/90/634790/2
Boden R 4 years ago
parent 5a8506fda6
commit 024802aafd
  1. 2
      neutron/agent/dhcp/agent.py
  2. 2
      neutron/agent/l3/agent.py
  3. 2
      neutron/agent/l3/extensions/port_forwarding.py
  4. 2
      neutron/agent/l3/extensions/qos/base.py
  5. 2
      neutron/agent/metadata/agent.py
  6. 2
      neutron/agent/resource_cache.py
  7. 7
      neutron/agent/rpc.py
  8. 2
      neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py
  9. 2
      neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py
  10. 2
      neutron/api/rpc/agentnotifiers/metering_rpc_agent_api.py
  11. 2
      neutron/api/rpc/handlers/dvr_rpc.py
  12. 2
      neutron/api/rpc/handlers/resources_rpc.py
  13. 2
      neutron/api/rpc/handlers/securitygroups_rpc.py
  14. 2
      neutron/api/v2/base.py
  15. 2
      neutron/cmd/eventlet/usage_audit.py
  16. 2
      neutron/common/config.py
  17. 33
      neutron/common/rpc.py
  18. 2
      neutron/db/l3_db.py
  19. 2
      neutron/extensions/dhcpagentscheduler.py
  20. 2
      neutron/extensions/l3agentscheduler.py
  21. 2
      neutron/extensions/tagging.py
  22. 2
      neutron/pecan_wsgi/hooks/notifier.py
  23. 3
      neutron/plugins/ml2/drivers/l2pop/rpc.py
  24. 2
      neutron/plugins/ml2/plugin.py
  25. 2
      neutron/plugins/ml2/rpc.py
  26. 2
      neutron/service.py
  27. 2
      neutron/services/l3_router/l3_router_plugin.py
  28. 2
      neutron/services/logapi/agent/l3/base.py
  29. 2
      neutron/services/logapi/rpc/agent.py
  30. 2
      neutron/services/logapi/rpc/server.py
  31. 2
      neutron/services/metering/agents/metering_agent.py
  32. 2
      neutron/services/metering/metering_plugin.py
  33. 2
      neutron/services/trunk/rpc/agent.py
  34. 2
      neutron/services/trunk/rpc/server.py
  35. 2
      neutron/tests/unit/agent/l3/extensions/qos/test_fip.py
  36. 2
      neutron/tests/unit/agent/l3/extensions/qos/test_gateway_ip.py
  37. 2
      neutron/tests/unit/agent/l3/extensions/test_port_forwarding.py
  38. 2
      neutron/tests/unit/agent/l3/extensions/test_snat_log.py
  39. 2
      neutron/tests/unit/agent/test_rpc.py
  40. 2
      neutron/tests/unit/agent/test_securitygroups_rpc.py
  41. 3
      neutron/tests/unit/api/rpc/agentnotifiers/test_l3_rpc_agent_api.py
  42. 2
      neutron/tests/unit/db/test_agentschedulers_db.py
  43. 2
      neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py
  44. 2
      neutron/tests/unit/scheduler/test_l3_agent_scheduler.py
  45. 2
      neutron/tests/unit/services/trunk/rpc/test_agent.py
  46. 2
      neutron/tests/unit/services/trunk/rpc/test_server.py

@ -23,6 +23,7 @@ from neutron_lib.agent import topics
from neutron_lib import constants
from neutron_lib import context
from neutron_lib import exceptions
from neutron_lib import rpc as n_rpc
from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_log import log as logging
@ -39,7 +40,6 @@ from neutron.agent.linux import external_process
from neutron.agent.metadata import driver as metadata_driver
from neutron.agent import rpc as agent_rpc
from neutron.common import constants as n_const
from neutron.common import rpc as n_rpc
from neutron.common import utils
from neutron import manager

@ -23,6 +23,7 @@ from neutron_lib.callbacks import resources
from neutron_lib import constants as lib_const
from neutron_lib import context as n_context
from neutron_lib.exceptions import l3 as l3_exc
from neutron_lib import rpc as n_rpc
from oslo_config import cfg
from oslo_context import context as common_context
from oslo_log import log as logging
@ -54,7 +55,6 @@ from neutron.agent.metadata import driver as metadata_driver
from neutron.agent import rpc as agent_rpc
from neutron.common import constants as l3_constants
from neutron.common import ipv6_utils
from neutron.common import rpc as n_rpc
from neutron.common import utils
from neutron import manager

@ -16,6 +16,7 @@
import collections
import netaddr
from neutron_lib import rpc as n_rpc
from oslo_concurrency import lockutils
from oslo_log import log as logging
@ -25,7 +26,6 @@ from neutron.api.rpc.callbacks import events
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import constants
from neutron.common import rpc as n_rpc
from neutron_lib.agent import l3_extension
from neutron_lib import constants as lib_consts

@ -17,6 +17,7 @@ import collections
from neutron_lib import constants
from neutron_lib.db import constants as db_consts
from neutron_lib import rpc as n_rpc
from neutron_lib.services.qos import constants as qos_consts
from oslo_log import log as logging
@ -24,7 +25,6 @@ from neutron.agent.linux import l3_tc_lib as tc_lib
from neutron.api.rpc.callbacks.consumer import registry
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import rpc as n_rpc
LOG = logging.getLogger(__name__)

@ -18,6 +18,7 @@ import hmac
from neutron_lib.agent import topics
from neutron_lib import constants
from neutron_lib import context
from neutron_lib import rpc as n_rpc
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging
@ -34,7 +35,6 @@ from neutron.agent import rpc as agent_rpc
from neutron.common import cache_utils as cache
from neutron.common import constants as n_const
from neutron.common import ipv6_utils
from neutron.common import rpc as n_rpc
from neutron.conf.agent.metadata import config
LOG = logging.getLogger(__name__)

@ -15,13 +15,13 @@
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib import context as n_ctx
from neutron_lib import rpc as n_rpc
from oslo_log import log as logging
from neutron._i18n import _
from neutron.api.rpc.callbacks.consumer import registry as registry_rpc
from neutron.api.rpc.callbacks import events as events_rpc
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import rpc as n_rpc
from neutron import objects
LOG = logging.getLogger(__name__)

@ -32,7 +32,6 @@ from oslo_utils import uuidutils
from neutron.agent import resource_cache
from neutron.api.rpc.callbacks import resources
from neutron.common import constants as n_const
from neutron.common import rpc as n_rpc
from neutron import objects
LOG = logging.getLogger(__name__)
@ -52,7 +51,7 @@ def create_consumers(endpoints, prefix, topic_details, start_listening=True):
:returns: A common Connection.
"""
connection = n_rpc.Connection()
connection = lib_rpc.Connection()
for details in topic_details:
topic, operation, node_name = itertools.islice(
itertools.chain(details, [None]), 3)
@ -80,7 +79,7 @@ class PluginReportStateAPI(object):
def __init__(self, topic):
target = oslo_messaging.Target(topic=topic, version='1.2',
namespace=n_const.RPC_NAMESPACE_STATE)
self.client = n_rpc.get_client(target)
self.client = lib_rpc.get_client(target)
def has_alive_neutron_server(self, context, **kwargs):
cctxt = self.client.prepare()
@ -117,7 +116,7 @@ class PluginApi(object):
def __init__(self, topic):
target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
self.client = lib_rpc.get_client(target)
def get_device_details(self, context, device, agent_id, host=None):
cctxt = self.client.prepare()

@ -23,11 +23,11 @@ from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging
from neutron.common import rpc as n_rpc
# Priorities - lower value is higher priority
PRIORITY_NETWORK_CREATE = 0

@ -20,11 +20,11 @@ from neutron_lib.api import extensions
from neutron_lib import constants
from neutron_lib.plugins import constants as plugin_constants
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from oslo_log import log as logging
import oslo_messaging
from neutron.api.rpc.agentnotifiers import utils as ag_utils
from neutron.common import rpc as n_rpc
LOG = logging.getLogger(__name__)

@ -17,10 +17,10 @@ from neutron_lib.api import extensions
from neutron_lib import constants
from neutron_lib.plugins import constants as plugin_constants
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from oslo_log import log as logging
import oslo_messaging
from neutron.common import rpc as n_rpc
from neutron.db import agentschedulers_db
LOG = logging.getLogger(__name__)

@ -15,12 +15,12 @@
from neutron_lib.agent import topics
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from oslo_log import helpers as log_helpers
from oslo_log import log as logging
import oslo_messaging
from neutron.common import constants
from neutron.common import rpc as n_rpc
LOG = logging.getLogger(__name__)

@ -17,6 +17,7 @@ import collections
from neutron_lib.agent import topics
from neutron_lib import exceptions
from neutron_lib import rpc as n_rpc
from oslo_log import helpers as log_helpers
from oslo_log import log as logging
import oslo_messaging
@ -28,7 +29,6 @@ from neutron.api.rpc.callbacks.producer import registry as prod_registry
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.callbacks import version_manager
from neutron.common import constants
from neutron.common import rpc as n_rpc
from neutron.objects import base as obj_base
LOG = logging.getLogger(__name__)

@ -18,13 +18,13 @@ from neutron_lib.agent import topics
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from neutron_lib.utils import net
from oslo_log import log as logging
import oslo_messaging
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import constants
from neutron.common import rpc as n_rpc
from neutron.db import securitygroups_rpc_base as sg_rpc_base
LOG = logging.getLogger(__name__)

@ -22,6 +22,7 @@ from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.db import api as db_api
from neutron_lib import exceptions
from neutron_lib import rpc as n_rpc
from oslo_log import log as logging
from oslo_policy import policy as oslo_policy
from oslo_utils import excutils
@ -31,7 +32,6 @@ from neutron._i18n import _
from neutron.api import api_common
from neutron.api.v2 import resource as wsgi_resource
from neutron.common import constants as n_const
from neutron.common import rpc as n_rpc
from neutron import policy
from neutron import quota
from neutron.quota import resource_registry

@ -22,9 +22,9 @@ import sys
from neutron_lib import context
from neutron_lib.plugins import constants
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from neutron.common import config
from neutron.common import rpc as n_rpc
from neutron import manager

@ -21,6 +21,7 @@ import sys
from keystoneauth1 import loading as ks_loading
from neutron_lib.api import validators
from neutron_lib import rpc as n_rpc
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging
@ -28,7 +29,6 @@ from oslo_middleware import cors
from oslo_service import wsgi
from neutron._i18n import _
from neutron.common import rpc as n_rpc
from neutron.conf import common as common_config
from neutron import policy
from neutron import version

@ -1,33 +0,0 @@
# 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
# 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_lib import rpc
# TODO(boden): remove lib rpc shims
TRANSPORT = rpc.TRANSPORT
NOTIFICATION_TRANSPORT = rpc.NOTIFICATION_TRANSPORT
NOTIFIER = rpc.NOTIFIER
init = rpc.init
cleanup = rpc.cleanup
BackingOffClient = rpc.BackingOffClient
get_client = rpc.get_client
get_server = rpc.get_server
get_notifier = rpc.get_notifier
RequestContextSerializer = rpc.RequestContextSerializer
Service = rpc.Service
Connection = rpc.Connection

@ -35,6 +35,7 @@ from neutron_lib.exceptions import l3 as l3_exc
from neutron_lib.plugins import constants as plugin_constants
from neutron_lib.plugins import directory
from neutron_lib.plugins import utils as plugin_utils
from neutron_lib import rpc as n_rpc
from neutron_lib.services import base as base_services
from oslo_log import log as logging
from oslo_utils import uuidutils
@ -44,7 +45,6 @@ from sqlalchemy.orm import exc
from neutron._i18n import _
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.common import ipv6_utils
from neutron.common import rpc as n_rpc
from neutron.common import utils
from neutron.db import _utils as db_utils
from neutron.db.models import l3 as l3_models

@ -21,11 +21,11 @@ from neutron_lib.api.definitions import network as net_apidef
from neutron_lib.api import extensions as api_extensions
from neutron_lib.api import faults
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
import six
from neutron.api import extensions
from neutron.api.v2 import resource
from neutron.common import rpc as n_rpc
from neutron import policy
from neutron import wsgi

@ -22,6 +22,7 @@ from neutron_lib import exceptions
from neutron_lib.exceptions import agent as agent_exc
from neutron_lib.plugins import constants as plugin_constants
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from oslo_log import log as logging
import six
import webob.exc
@ -29,7 +30,6 @@ import webob.exc
from neutron._i18n import _
from neutron.api import extensions
from neutron.api.v2 import resource
from neutron.common import rpc as n_rpc
from neutron import policy
from neutron import wsgi

@ -18,6 +18,7 @@ from neutron_lib.api import faults
from neutron_lib.api import validators
from neutron_lib import exceptions
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from neutron_lib.services import base as service_base
import six
import webob.exc
@ -25,7 +26,6 @@ import webob.exc
from neutron._i18n import _
from neutron.api import extensions
from neutron.api.v2 import resource as api_resource
from neutron.common import rpc as n_rpc
from neutron.db import standard_attr

@ -15,10 +15,10 @@
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib import rpc as n_rpc
from oslo_log import log
from pecan import hooks
from neutron.common import rpc as n_rpc
from neutron.pecan_wsgi import constants as pecan_constants
from neutron.pecan_wsgi.hooks import utils

@ -16,11 +16,10 @@
import collections
from neutron_lib.agent import topics
from neutron_lib import rpc as n_rpc
from oslo_log import log as logging
import oslo_messaging
from neutron.common import rpc as n_rpc
LOG = logging.getLogger(__name__)

@ -46,6 +46,7 @@ from neutron_lib.plugins import constants as plugin_constants
from neutron_lib.plugins import directory
from neutron_lib.plugins.ml2 import api
from neutron_lib.plugins import utils as p_utils
from neutron_lib import rpc as n_rpc
from neutron_lib.services.qos import constants as qos_consts
from oslo_config import cfg
from oslo_db import exception as os_db_exception
@ -68,7 +69,6 @@ from neutron.api.rpc.handlers import metadata_rpc
from neutron.api.rpc.handlers import resources_rpc
from neutron.api.rpc.handlers import securitygroups_rpc
from neutron.common import constants as n_const
from neutron.common import rpc as n_rpc
from neutron.common import utils
from neutron.db import address_scope_db
from neutron.db import agents_db

@ -21,6 +21,7 @@ from neutron_lib.callbacks import resources
from neutron_lib import constants as n_const
from neutron_lib.plugins import directory
from neutron_lib.plugins.ml2 import api
from neutron_lib import rpc as n_rpc
from neutron_lib.services.qos import constants as qos_consts
from oslo_log import log
import oslo_messaging
@ -30,7 +31,6 @@ from neutron.agent import _topics as n_topics
from neutron.api.rpc.handlers import dvr_rpc
from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc
from neutron.common import constants as c_const
from neutron.common import rpc as n_rpc
from neutron.db import l3_hamode_db
from neutron.db import provisioning_blocks
from neutron.plugins.ml2 import db as ml2_db

@ -23,6 +23,7 @@ from neutron_lib.callbacks import resources
from neutron_lib import context
from neutron_lib.db import api as session
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from neutron_lib import worker as neutron_worker
from oslo_concurrency import processutils
from oslo_config import cfg
@ -35,7 +36,6 @@ from oslo_utils import importutils
from neutron.common import config
from neutron.common import profiler
from neutron.common import rpc as n_rpc
from neutron.conf import service
from neutron import wsgi

@ -18,6 +18,7 @@ from neutron_lib.api.definitions import l3 as l3_apidef
from neutron_lib import constants as n_const
from neutron_lib.db import resource_extend
from neutron_lib.plugins import constants as plugin_constants
from neutron_lib import rpc as n_rpc
from neutron_lib.services import base as service_base
from oslo_config import cfg
from oslo_log import helpers as log_helpers
@ -26,7 +27,6 @@ from oslo_utils import importutils
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.rpc.handlers import l3_rpc
from neutron.common import rpc as n_rpc
from neutron.db import common_db_mixin
from neutron.db import dns_db
from neutron.db import extraroute_db

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib import rpc as n_rpc
from oslo_concurrency import lockutils
from oslo_log import log as logging
@ -20,7 +21,6 @@ from neutron.api.rpc.callbacks.consumer import registry
from neutron.api.rpc.callbacks import events
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import rpc as n_rpc
from neutron.conf.services import logging as log_cfg
from neutron import manager

@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from neutron_lib import rpc as n_rpc
from oslo_log import helpers as log_helpers
import oslo_messaging
from neutron.common import rpc as n_rpc
from neutron.services.logapi.common import constants as log_const

@ -14,13 +14,13 @@
# under the License.
from neutron_lib.callbacks import resources as r_const
from neutron_lib import rpc as n_rpc
from oslo_log import helpers as log_helpers
from oslo_log import log as logging
import oslo_messaging
from neutron.api.rpc.callbacks import events
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import rpc as n_rpc
from neutron.services.logapi.common import constants as log_const
from neutron.services.logapi.common import db_api

@ -17,6 +17,7 @@ import sys
from neutron_lib.agent import topics
from neutron_lib import constants
from neutron_lib import context
from neutron_lib import rpc as n_rpc
from neutron_lib.utils import runtime
from oslo_config import cfg
from oslo_log import log as logging
@ -30,7 +31,6 @@ from neutron._i18n import _
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 as n_rpc
from neutron.conf.agent import common as config
from neutron.conf.services import metering_agent
from neutron import manager

@ -14,9 +14,9 @@
from neutron_lib.agent import topics
from neutron_lib.api.definitions import metering as metering_apidef
from neutron_lib import rpc as n_rpc
from neutron.api.rpc.agentnotifiers import metering_rpc_agent_api
from neutron.common import rpc as n_rpc
from neutron.db.metering import metering_db
from neutron.db.metering import metering_rpc
from neutron import service

@ -14,13 +14,13 @@
import abc
from neutron_lib import rpc as n_rpc
from oslo_log import helpers as log_helpers
import oslo_messaging
from neutron.api.rpc.callbacks.consumer import registry
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import rpc as n_rpc
from neutron.services.trunk.rpc import constants as trunk_consts
# This module contains stub (client-side) and skeleton (server-side)

@ -17,6 +17,7 @@ import collections
from neutron_lib.api.definitions import portbindings
from neutron_lib.db import api as db_api
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from oslo_log import helpers as log_helpers
from oslo_log import log as logging
import oslo_messaging
@ -25,7 +26,6 @@ from neutron.api.rpc.callbacks import events
from neutron.api.rpc.callbacks.producer import registry
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import rpc as n_rpc
from neutron.objects import trunk as trunk_objects
from neutron.services.trunk import constants as trunk_consts
from neutron.services.trunk import exceptions as trunk_exc

@ -16,6 +16,7 @@
import mock
from neutron_lib import constants as lib_const
from neutron_lib import context
from neutron_lib import rpc as n_rpc
from neutron_lib.services.qos import constants as qos_consts
from oslo_utils import uuidutils
@ -26,7 +27,6 @@ from neutron.agent.l3 import router_info as l3router
from neutron.api.rpc.callbacks.consumer import registry
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import rpc as n_rpc
from neutron.objects.qos import policy
from neutron.objects.qos import rule
from neutron.tests import base

@ -139,7 +139,7 @@ class RouterGatewayIPQosAgentExtensionInitializeTestCase(
@mock.patch.object(registry, 'register')
@mock.patch.object(resources_rpc, 'ResourcesPushRpcCallback')
def test_initialize_subscribed_to_rpc(self, rpc_mock, subscribe_mock):
call_to_patch = 'neutron.common.rpc.Connection'
call_to_patch = 'neutron_lib.rpc.Connection'
with mock.patch(call_to_patch,
return_value=self.connection) as create_connection:
self.gw_ip_qos_ext.initialize(

@ -103,7 +103,7 @@ class FipPortForwardingExtensionInitializeTestCase(
@mock.patch.object(registry, 'register')
@mock.patch.object(resources_rpc, 'ResourcesPushRpcCallback')
def test_initialize_subscribed_to_rpc(self, rpc_mock, subscribe_mock):
call_to_patch = 'neutron.common.rpc.Connection'
call_to_patch = 'neutron_lib.rpc.Connection'
with mock.patch(call_to_patch,
return_value=self.connection) as create_connection:
self.fip_pf_ext.initialize(

@ -33,7 +33,7 @@ class SnatLogExtensionInitializeTestCase(test_base.L3LoggingExtBaseTestCase):
@mock.patch.object(registry, 'register')
@mock.patch.object(resources_rpc, 'ResourcesPushRpcCallback')
def test_initialize_subscribed_to_rpc(self, rpc_mock, subscribe_mock):
call_to_patch = 'neutron.common.rpc.Connection'
call_to_patch = 'neutron_lib.rpc.Connection'
with mock.patch(call_to_patch,
return_value=self.connection) as create_connection:
self.snat_log_ext.initialize(

@ -21,12 +21,12 @@ from neutron_lib.agent import topics as lib_topics
from neutron_lib.callbacks import events
from neutron_lib.callbacks import resources
from neutron_lib import constants
from neutron_lib import rpc as n_rpc
from oslo_context import context as oslo_context
from oslo_utils import uuidutils
from neutron.agent import rpc
from neutron.common import constants as n_const
from neutron.common import rpc as n_rpc
from neutron.objects import network
from neutron.objects import ports
from neutron.tests import base

@ -22,6 +22,7 @@ from neutron_lib.api.definitions import allowedaddresspairs as addr_apidef
from neutron_lib import constants as const
from neutron_lib import context
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from oslo_config import cfg
import oslo_messaging
from testtools import matchers
@ -32,7 +33,6 @@ from neutron.agent.linux import ip_conntrack
from neutron.agent.linux import iptables_manager
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.api.rpc.handlers import securitygroups_rpc
from neutron.common import rpc as n_rpc
from neutron.db import securitygroups_rpc_base as sg_db_rpc
from neutron.extensions import securitygroup as ext_sg
from neutron.tests import base

@ -15,8 +15,9 @@
import mock
from neutron_lib import rpc
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.common import rpc
from neutron.tests import base

@ -21,6 +21,7 @@ from neutron_lib import constants
from neutron_lib import context
from neutron_lib.plugins import constants as plugin_constants
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from neutron_lib.tests.unit import fake_notifier
from oslo_config import cfg
from oslo_db import exception as db_exc
@ -33,7 +34,6 @@ from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.rpc.handlers import dhcp_rpc
from neutron.api.rpc.handlers import l3_rpc
from neutron.common import rpc as n_rpc
from neutron.db import agents_db
from neutron.db import agentschedulers_db
from neutron.db.models import agent as agent_model

@ -18,6 +18,7 @@ import time
import mock
from neutron_lib.agent import constants as agent_consts
from neutron_lib import constants as n_const
from neutron_lib import rpc as n_rpc
from oslo_config import cfg
from oslo_log import log
import oslo_messaging
@ -30,7 +31,6 @@ from neutron.agent.common import polling
from neutron.agent.common import utils
from neutron.agent.linux import ip_lib
from neutron.common import constants as c_const
from neutron.common import rpc as n_rpc
from neutron.plugins.ml2.drivers.l2pop import rpc as l2pop_rpc
from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants
from neutron.plugins.ml2.drivers.openvswitch.agent import ovs_neutron_agent \

@ -24,6 +24,7 @@ from neutron_lib import context as n_context
from neutron_lib.exceptions import l3 as l3_exc
from neutron_lib.plugins import constants as plugin_constants
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from oslo_config import cfg
from oslo_utils import importutils
from oslo_utils import timeutils
@ -32,7 +33,6 @@ from sqlalchemy import orm
import testscenarios
import testtools
from neutron.common import rpc as n_rpc
from neutron.db import db_base_plugin_v2 as db_v2
from neutron.db import l3_db
from neutron.db import l3_dvr_db

@ -12,12 +12,12 @@
# under the License.
import mock
from neutron_lib import rpc
from oslo_config import cfg
import oslo_messaging
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import rpc
from neutron.services.trunk.rpc import agent
from neutron.tests import base

@ -14,11 +14,11 @@
import mock
from neutron_lib.api.definitions import portbindings
from neutron_lib.plugins import directory
from neutron_lib import rpc as n_rpc
from neutron.api.rpc.callbacks import events
from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc
from neutron.common import rpc as n_rpc
from neutron.objects import trunk as trunk_obj
from neutron.plugins.ml2 import plugin as ml2_plugin
from neutron.services.trunk import constants

Loading…
Cancel
Save