From 20803ea6379d5f646a1cdfd46ff89acbea2ad902 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Thu, 9 Oct 2014 16:21:49 +0200 Subject: [PATCH] Migrate to oslo.utils The following modules are removed: - excutils, - importutils, - network_utils, - strutils, - timeutils. Closes-Bug: #1385355 Change-Id: I1f34f17f5dbf37032584008f27e65d4dc4d475f4 --- neutron/agent/dhcp_agent.py | 2 +- neutron/agent/l3_agent.py | 6 +- neutron/agent/linux/dhcp.py | 2 +- neutron/agent/linux/interface.py | 2 +- neutron/agent/linux/iptables_manager.py | 2 +- neutron/agent/linux/ovs_lib.py | 2 +- neutron/agent/linux/utils.py | 2 +- neutron/agent/metadata/agent.py | 2 +- neutron/agent/netns_cleanup_util.py | 2 +- neutron/agent/rpc.py | 2 +- neutron/agent/securitygroups_rpc.py | 2 +- neutron/api/rpc/handlers/dhcp_rpc.py | 2 +- neutron/api/v2/base.py | 2 +- neutron/common/exceptions.py | 2 +- neutron/common/utils.py | 2 +- neutron/db/agents_db.py | 4 +- neutron/db/db_base_plugin_v2.py | 2 +- neutron/db/l3_agentschedulers_db.py | 2 +- neutron/db/l3_hamode_db.py | 2 +- neutron/db/loadbalancer/loadbalancer_db.py | 2 +- neutron/db/vpn/vpn_db.py | 2 +- neutron/debug/shell.py | 2 +- neutron/extensions/quotasv2.py | 2 +- neutron/manager.py | 2 +- neutron/openstack/common/excutils.py | 113 --------- neutron/openstack/common/importutils.py | 73 ------ neutron/openstack/common/network_utils.py | 89 ------- neutron/openstack/common/strutils.py | 239 ------------------ neutron/openstack/common/timeutils.py | 210 --------------- .../bigswitch/agent/restproxy_agent.py | 2 +- neutron/plugins/bigswitch/l3_router_plugin.py | 2 +- neutron/plugins/bigswitch/plugin.py | 2 +- neutron/plugins/bigswitch/servermanager.py | 2 +- neutron/plugins/brocade/NeutronPlugin.py | 2 +- neutron/plugins/brocade/nos/nosdriver.py | 2 +- neutron/plugins/cisco/cfg_agent/cfg_agent.py | 4 +- .../cfg_agent/device_drivers/driver_mgr.py | 5 +- .../plugins/cisco/cfg_agent/device_status.py | 2 +- .../service_helpers/routing_svc_helper.py | 4 +- .../plugins/cisco/db/l3/device_handling_db.py | 4 +- .../plugins/cisco/models/virt_phy_sw_v2.py | 5 +- .../plugins/cisco/n1kv/n1kv_neutron_plugin.py | 4 +- neutron/plugins/cisco/network_plugin.py | 3 +- neutron/plugins/ibm/sdnve_neutron_plugin.py | 2 +- .../plugins/metaplugin/meta_neutron_plugin.py | 2 +- neutron/plugins/midonet/plugin.py | 2 +- .../ml2/drivers/brocade/mechanism_brocade.py | 2 +- .../ml2/drivers/brocade/nos/nosdriver.py | 2 +- .../cisco/nexus/nexus_network_driver.py | 5 +- neutron/plugins/ml2/drivers/l2pop/db.py | 2 +- .../ml2/drivers/mech_bigswitch/driver.py | 4 +- neutron/plugins/ml2/drivers/mechanism_odl.py | 2 +- neutron/plugins/ml2/plugin.py | 4 +- neutron/plugins/mlnx/agent/utils.py | 2 +- neutron/plugins/mlnx/mlnx_plugin.py | 2 +- neutron/plugins/nec/common/ofc_client.py | 2 +- neutron/plugins/nec/drivers/__init__.py | 3 +- neutron/plugins/nec/nec_plugin.py | 4 +- neutron/plugins/nec/nec_router.py | 5 +- neutron/plugins/nec/packet_filter.py | 3 +- neutron/plugins/nec/router_drivers.py | 2 +- neutron/plugins/nuage/plugin.py | 4 +- neutron/plugins/nuage/syncmanager.py | 2 +- neutron/plugins/oneconvergence/lib/nvsdlib.py | 2 +- neutron/plugins/oneconvergence/plugin.py | 4 +- .../agent/ovs_dvr_neutron_agent.py | 2 +- .../plumgrid_plugin/plumgrid_plugin.py | 2 +- neutron/plugins/vmware/api_client/request.py | 4 +- neutron/plugins/vmware/common/sync.py | 2 +- neutron/plugins/vmware/dbexts/db.py | 2 +- .../plugins/vmware/dhcp_meta/lsnmanager.py | 2 +- neutron/plugins/vmware/dhcp_meta/nsx.py | 2 +- neutron/plugins/vmware/dhcpmeta_modes.py | 2 +- neutron/plugins/vmware/nsxlib/queue.py | 2 +- neutron/plugins/vmware/nsxlib/router.py | 2 +- neutron/plugins/vmware/nsxlib/secgroup.py | 2 +- neutron/plugins/vmware/plugins/base.py | 2 +- neutron/plugins/vmware/plugins/service.py | 2 +- .../vmware/vshield/edge_appliance_driver.py | 2 +- .../vmware/vshield/edge_firewall_driver.py | 3 +- .../vmware/vshield/edge_ipsecvpn_driver.py | 3 +- .../vshield/edge_loadbalancer_driver.py | 3 +- neutron/policy.py | 4 +- neutron/quota.py | 2 +- neutron/service.py | 4 +- .../agents/l3reference/firewall_l3_agent.py | 2 +- .../l3_router/brocade/l3_router_plugin.py | 2 +- neutron/services/l3_router/l3_apic.py | 2 +- neutron/services/l3_router/l3_arista.py | 2 +- .../services/l3_router/l3_router_plugin.py | 2 +- .../loadbalancer/agent/agent_manager.py | 2 +- .../drivers/common/agent_driver_base.py | 2 +- .../drivers/haproxy/namespace_driver.py | 4 +- .../loadbalancer/drivers/radware/driver.py | 2 +- neutron/services/loadbalancer/plugin.py | 3 +- .../metering/agents/metering_agent.py | 2 +- .../drivers/iptables/iptables_driver.py | 2 +- neutron/services/service_base.py | 4 +- neutron/services/vpn/agent.py | 3 +- .../functional/agent/linux/test_ip_lib.py | 2 +- .../agentnotifiers/test_dhcp_rpc_agent_api.py | 3 +- .../unit/bigswitch/test_restproxy_agent.py | 2 +- .../unit/bigswitch/test_servermanager.py | 2 +- .../tests/unit/brocade/test_brocade_plugin.py | 2 +- .../cisco/l3/device_handling_test_support.py | 2 +- .../l3/test_l3_router_appliance_plugin.py | 2 +- .../unit/db/firewall/test_db_firewall.py | 2 +- neutron/tests/unit/db/test_agent_db.py | 2 +- .../drivers/brocade/test_brocade_l3_plugin.py | 2 +- .../brocade/test_brocade_mechanism_driver.py | 2 +- .../drivers/cisco/nexus/test_cisco_nexus.py | 2 +- .../unit/ml2/drivers/test_l2population.py | 3 +- neutron/tests/unit/ofagent/ofa_test_base.py | 2 +- neutron/tests/unit/ofagent/test_arp_lib.py | 2 +- neutron/tests/unit/ofagent/test_ofa_flows.py | 2 +- .../unit/ofagent/test_ofa_neutron_agent.py | 2 +- neutron/tests/unit/ofagent/test_ofswitch.py | 2 +- .../unit/openvswitch/test_agent_scheduler.py | 2 +- .../extensions/test_securitygroups.py | 2 +- .../unit/plumgrid/test_plumgrid_plugin.py | 2 +- .../l3reference/test_firewall_l3_agent.py | 4 +- .../services/l3_router/test_l3_apic_plugin.py | 3 +- .../services/metering/test_metering_plugin.py | 2 +- neutron/tests/unit/test_agent_ext_plugin.py | 2 +- .../tests/unit/test_agent_netns_cleanup.py | 2 +- neutron/tests/unit/test_db_plugin.py | 2 +- neutron/tests/unit/test_dhcp_scheduler.py | 3 +- neutron/tests/unit/test_l3_plugin.py | 2 +- neutron/tests/unit/test_l3_schedulers.py | 4 +- neutron/tests/unit/test_metadata_agent.py | 2 +- neutron/tests/unit/test_policy.py | 2 +- neutron/wsgi.py | 2 +- openstack-common.conf | 5 - 133 files changed, 164 insertions(+), 881 deletions(-) delete mode 100644 neutron/openstack/common/excutils.py delete mode 100644 neutron/openstack/common/importutils.py delete mode 100644 neutron/openstack/common/network_utils.py delete mode 100644 neutron/openstack/common/strutils.py delete mode 100644 neutron/openstack/common/timeutils.py diff --git a/neutron/agent/dhcp_agent.py b/neutron/agent/dhcp_agent.py index d1455346cd..95182c99e1 100644 --- a/neutron/agent/dhcp_agent.py +++ b/neutron/agent/dhcp_agent.py @@ -23,6 +23,7 @@ eventlet.monkey_patch() import netaddr from oslo.config import cfg from oslo import messaging +from oslo.utils import importutils from neutron.agent.common import config from neutron.agent.linux import dhcp @@ -39,7 +40,6 @@ from neutron.common import utils from neutron import context from neutron import manager from neutron.openstack.common.gettextutils import _LE, _LI, _LW -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.openstack.common import loopingcall from neutron.openstack.common import service diff --git a/neutron/agent/l3_agent.py b/neutron/agent/l3_agent.py index 728df02351..32bbc1acee 100644 --- a/neutron/agent/l3_agent.py +++ b/neutron/agent/l3_agent.py @@ -23,6 +23,9 @@ import netaddr import os from oslo.config import cfg from oslo import messaging +from oslo.utils import excutils +from oslo.utils import importutils +from oslo.utils import timeutils import Queue from neutron.agent.common import config @@ -42,15 +45,12 @@ from neutron.common import topics from neutron.common import utils as common_utils from neutron import context as n_context from neutron import manager -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI, _LW -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.openstack.common import loopingcall from neutron.openstack.common import periodic_task from neutron.openstack.common import processutils from neutron.openstack.common import service -from neutron.openstack.common import timeutils from neutron import service as neutron_service from neutron.services.firewall.agents.l3reference import firewall_l3_agent diff --git a/neutron/agent/linux/dhcp.py b/neutron/agent/linux/dhcp.py index 714b2070f8..ceae81c114 100644 --- a/neutron/agent/linux/dhcp.py +++ b/neutron/agent/linux/dhcp.py @@ -24,6 +24,7 @@ import sys import netaddr from oslo.config import cfg from oslo.serialization import jsonutils +from oslo.utils import importutils import six from neutron.agent.linux import ip_lib @@ -32,7 +33,6 @@ from neutron.common import constants from neutron.common import exceptions from neutron.common import utils as commonutils from neutron.openstack.common.gettextutils import _LE -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.openstack.common import uuidutils diff --git a/neutron/agent/linux/interface.py b/neutron/agent/linux/interface.py index fdc1d8e3f6..adbd0e9fdf 100644 --- a/neutron/agent/linux/interface.py +++ b/neutron/agent/linux/interface.py @@ -17,6 +17,7 @@ import abc import netaddr from oslo.config import cfg +from oslo.utils import importutils import six from neutron.agent.common import config @@ -27,7 +28,6 @@ from neutron.common import constants as n_const from neutron.common import exceptions from neutron.extensions import flavor from neutron.openstack.common.gettextutils import _LE, _LI -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging diff --git a/neutron/agent/linux/iptables_manager.py b/neutron/agent/linux/iptables_manager.py index 1351559397..b59c43ba3d 100644 --- a/neutron/agent/linux/iptables_manager.py +++ b/neutron/agent/linux/iptables_manager.py @@ -23,12 +23,12 @@ import os import re from oslo.config import cfg +from oslo.utils import excutils from neutron.agent.common import config from neutron.agent.linux import iptables_comments as ic from neutron.agent.linux import utils as linux_utils from neutron.common import utils -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LW from neutron.openstack.common import lockutils from neutron.openstack.common import log as logging diff --git a/neutron/agent/linux/ovs_lib.py b/neutron/agent/linux/ovs_lib.py index a2a8d4b3a4..a500e51d37 100644 --- a/neutron/agent/linux/ovs_lib.py +++ b/neutron/agent/linux/ovs_lib.py @@ -18,11 +18,11 @@ import operator from oslo.config import cfg from oslo.serialization import jsonutils +from oslo.utils import excutils from neutron.agent.linux import ip_lib from neutron.agent.linux import utils from neutron.common import exceptions -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI, _LW from neutron.openstack.common import log as logging from neutron.plugins.common import constants diff --git a/neutron/agent/linux/utils.py b/neutron/agent/linux/utils.py index c10d79cd00..5f59adde8f 100644 --- a/neutron/agent/linux/utils.py +++ b/neutron/agent/linux/utils.py @@ -23,10 +23,10 @@ import tempfile from eventlet.green import subprocess from eventlet import greenthread +from oslo.utils import excutils from neutron.common import constants from neutron.common import utils -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging diff --git a/neutron/agent/metadata/agent.py b/neutron/agent/metadata/agent.py index 1a9e84774f..e0f78c014d 100644 --- a/neutron/agent/metadata/agent.py +++ b/neutron/agent/metadata/agent.py @@ -25,6 +25,7 @@ import httplib2 from neutronclient.v2_0 import client from oslo.config import cfg from oslo import messaging +from oslo.utils import excutils import six.moves.urllib.parse as urlparse import webob @@ -37,7 +38,6 @@ from neutron.common import topics from neutron.common import utils from neutron import context from neutron.openstack.common.cache import cache -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LW from neutron.openstack.common import log as logging from neutron.openstack.common import loopingcall diff --git a/neutron/agent/netns_cleanup_util.py b/neutron/agent/netns_cleanup_util.py index d6eafffe10..f40d5e4082 100644 --- a/neutron/agent/netns_cleanup_util.py +++ b/neutron/agent/netns_cleanup_util.py @@ -19,6 +19,7 @@ import eventlet eventlet.monkey_patch() from oslo.config import cfg +from oslo.utils import importutils from neutron.agent.common import config as agent_config from neutron.agent import dhcp_agent @@ -30,7 +31,6 @@ from neutron.agent.linux import ovs_lib from neutron.api.v2 import attributes from neutron.common import config from neutron.openstack.common.gettextutils import _LE -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging diff --git a/neutron/agent/rpc.py b/neutron/agent/rpc.py index 48876ccdda..3f8d5e291e 100644 --- a/neutron/agent/rpc.py +++ b/neutron/agent/rpc.py @@ -15,12 +15,12 @@ import itertools from oslo import messaging +from oslo.utils import timeutils from neutron.common import rpc as n_rpc from neutron.common import topics from neutron.openstack.common.gettextutils import _LW from neutron.openstack.common import log as logging -from neutron.openstack.common import timeutils LOG = logging.getLogger(__name__) diff --git a/neutron/agent/securitygroups_rpc.py b/neutron/agent/securitygroups_rpc.py index 78439b0523..a6aab260d8 100644 --- a/neutron/agent/securitygroups_rpc.py +++ b/neutron/agent/securitygroups_rpc.py @@ -18,11 +18,11 @@ import functools from oslo.config import cfg from oslo import messaging +from oslo.utils import importutils from neutron.agent import firewall from neutron.common import topics from neutron.openstack.common.gettextutils import _LI, _LW -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/neutron/api/rpc/handlers/dhcp_rpc.py b/neutron/api/rpc/handlers/dhcp_rpc.py index d2ba30d999..add359cafb 100644 --- a/neutron/api/rpc/handlers/dhcp_rpc.py +++ b/neutron/api/rpc/handlers/dhcp_rpc.py @@ -16,6 +16,7 @@ from oslo.config import cfg from oslo.db import exception as db_exc from oslo import messaging +from oslo.utils import excutils from neutron.api.v2 import attributes from neutron.common import constants @@ -23,7 +24,6 @@ from neutron.common import exceptions as n_exc from neutron.common import utils from neutron.extensions import portbindings from neutron import manager -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LW from neutron.openstack.common import log as logging diff --git a/neutron/api/v2/base.py b/neutron/api/v2/base.py index 5af0d81dc4..a68477f6e1 100644 --- a/neutron/api/v2/base.py +++ b/neutron/api/v2/base.py @@ -18,6 +18,7 @@ import netaddr import webob.exc from oslo.config import cfg +from oslo.utils import excutils from neutron.api import api_common from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api @@ -26,7 +27,6 @@ from neutron.api.v2 import resource as wsgi_resource from neutron.common import constants as const from neutron.common import exceptions from neutron.common import rpc as n_rpc -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI from neutron.openstack.common import log as logging from neutron.openstack.common import policy as common_policy diff --git a/neutron/common/exceptions.py b/neutron/common/exceptions.py index dc9a8b611b..ccbe891ca0 100644 --- a/neutron/common/exceptions.py +++ b/neutron/common/exceptions.py @@ -17,7 +17,7 @@ Neutron base exception handling. """ -from neutron.openstack.common import excutils +from oslo.utils import excutils class NeutronException(Exception): diff --git a/neutron/common/utils.py b/neutron/common/utils.py index 5bb893faaf..a5ae64a1ae 100644 --- a/neutron/common/utils.py +++ b/neutron/common/utils.py @@ -31,9 +31,9 @@ import uuid from eventlet.green import subprocess from oslo.config import cfg +from oslo.utils import excutils from neutron.common import constants as q_const -from neutron.openstack.common import excutils from neutron.openstack.common import lockutils from neutron.openstack.common import log as logging diff --git a/neutron/db/agents_db.py b/neutron/db/agents_db.py index 5893ef1e7f..9f13ef487e 100644 --- a/neutron/db/agents_db.py +++ b/neutron/db/agents_db.py @@ -19,6 +19,8 @@ from oslo.config import cfg from oslo.db import exception as db_exc from oslo import messaging from oslo.serialization import jsonutils +from oslo.utils import excutils +from oslo.utils import timeutils import sqlalchemy as sa from sqlalchemy.orm import exc from sqlalchemy import sql @@ -27,10 +29,8 @@ from neutron.db import model_base from neutron.db import models_v2 from neutron.extensions import agent as ext_agent from neutron import manager -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LW from neutron.openstack.common import log as logging -from neutron.openstack.common import timeutils LOG = logging.getLogger(__name__) cfg.CONF.register_opt( diff --git a/neutron/db/db_base_plugin_v2.py b/neutron/db/db_base_plugin_v2.py index b6288ddfab..e7108e2c67 100644 --- a/neutron/db/db_base_plugin_v2.py +++ b/neutron/db/db_base_plugin_v2.py @@ -17,6 +17,7 @@ import random import netaddr from oslo.config import cfg +from oslo.utils import excutils from sqlalchemy import and_ from sqlalchemy import event from sqlalchemy import orm @@ -33,7 +34,6 @@ from neutron.db import sqlalchemyutils from neutron.extensions import l3 from neutron import manager from neutron import neutron_plugin_base_v2 -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI from neutron.openstack.common import log as logging from neutron.openstack.common import uuidutils diff --git a/neutron/db/l3_agentschedulers_db.py b/neutron/db/l3_agentschedulers_db.py index dd3d7ee8af..c2308cb5a7 100644 --- a/neutron/db/l3_agentschedulers_db.py +++ b/neutron/db/l3_agentschedulers_db.py @@ -19,6 +19,7 @@ import time from oslo.config import cfg from oslo.db import exception as db_exc from oslo import messaging +from oslo.utils import timeutils import sqlalchemy as sa from sqlalchemy import func from sqlalchemy import orm @@ -38,7 +39,6 @@ from neutron import manager from neutron.openstack.common.gettextutils import _LE, _LI, _LW from neutron.openstack.common import log as logging from neutron.openstack.common import loopingcall -from neutron.openstack.common import timeutils LOG = logging.getLogger(__name__) diff --git a/neutron/db/l3_hamode_db.py b/neutron/db/l3_hamode_db.py index a35709eada..3d28f86676 100644 --- a/neutron/db/l3_hamode_db.py +++ b/neutron/db/l3_hamode_db.py @@ -16,6 +16,7 @@ import netaddr from oslo.config import cfg from oslo.db import exception as db_exc +from oslo.utils import excutils import sqlalchemy as sa from sqlalchemy import orm @@ -26,7 +27,6 @@ from neutron.db import l3_dvr_db from neutron.db import model_base from neutron.db import models_v2 from neutron.extensions import l3_ext_ha_mode as l3_ha -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LI from neutron.openstack.common.gettextutils import _LW from neutron.openstack.common import log as logging diff --git a/neutron/db/loadbalancer/loadbalancer_db.py b/neutron/db/loadbalancer/loadbalancer_db.py index 1baffc1bcd..651d3351f8 100644 --- a/neutron/db/loadbalancer/loadbalancer_db.py +++ b/neutron/db/loadbalancer/loadbalancer_db.py @@ -14,6 +14,7 @@ # from oslo.db import exception +from oslo.utils import excutils import sqlalchemy as sa from sqlalchemy import orm from sqlalchemy.orm import exc @@ -27,7 +28,6 @@ from neutron.db import models_v2 from neutron.db import servicetype_db as st_db from neutron.extensions import loadbalancer from neutron import manager -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.openstack.common import uuidutils from neutron.plugins.common import constants diff --git a/neutron/db/vpn/vpn_db.py b/neutron/db/vpn/vpn_db.py index 6783200249..c32f984867 100644 --- a/neutron/db/vpn/vpn_db.py +++ b/neutron/db/vpn/vpn_db.py @@ -14,6 +14,7 @@ # under the License. import netaddr +from oslo.utils import excutils import sqlalchemy as sa from sqlalchemy import orm from sqlalchemy.orm import exc @@ -27,7 +28,6 @@ from neutron.db import models_v2 from neutron.db.vpn import vpn_validator from neutron.extensions import vpnaas from neutron import manager -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LW from neutron.openstack.common import log as logging from neutron.openstack.common import uuidutils diff --git a/neutron/debug/shell.py b/neutron/debug/shell.py index 73b075cfc6..c5f66357da 100644 --- a/neutron/debug/shell.py +++ b/neutron/debug/shell.py @@ -16,11 +16,11 @@ import sys from oslo.config import cfg +from oslo.utils import importutils from neutron.agent.common import config from neutron.agent.linux import interface from neutron.debug import debug_agent -from neutron.openstack.common import importutils from neutronclient.common import exceptions as exc from neutronclient import shell diff --git a/neutron/extensions/quotasv2.py b/neutron/extensions/quotasv2.py index 19fa85dbff..43d9e214c3 100644 --- a/neutron/extensions/quotasv2.py +++ b/neutron/extensions/quotasv2.py @@ -14,6 +14,7 @@ # under the License. from oslo.config import cfg +from oslo.utils import importutils import webob from neutron.api import extensions @@ -23,7 +24,6 @@ from neutron.api.v2 import resource from neutron.common import constants as const from neutron.common import exceptions as n_exc from neutron import manager -from neutron.openstack.common import importutils from neutron import quota from neutron import wsgi diff --git a/neutron/manager.py b/neutron/manager.py index 3a21f617f5..ac16df86c7 100644 --- a/neutron/manager.py +++ b/neutron/manager.py @@ -16,10 +16,10 @@ import weakref from oslo.config import cfg +from oslo.utils import importutils 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 from neutron.openstack.common import periodic_task from neutron.plugins.common import constants diff --git a/neutron/openstack/common/excutils.py b/neutron/openstack/common/excutils.py deleted file mode 100644 index 5b3c5c86b4..0000000000 --- a/neutron/openstack/common/excutils.py +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright 2011 OpenStack Foundation. -# Copyright 2012, Red Hat, Inc. -# -# 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. - -""" -Exception related utilities. -""" - -import logging -import sys -import time -import traceback - -import six - -from neutron.openstack.common.gettextutils import _LE - - -class save_and_reraise_exception(object): - """Save current exception, run some code and then re-raise. - - In some cases the exception context can be cleared, resulting in None - being attempted to be re-raised after an exception handler is run. This - can happen when eventlet switches greenthreads or when running an - exception handler, code raises and catches an exception. In both - cases the exception context will be cleared. - - To work around this, we save the exception state, run handler code, and - then re-raise the original exception. If another exception occurs, the - saved exception is logged and the new exception is re-raised. - - In some cases the caller may not want to re-raise the exception, and - for those circumstances this context provides a reraise flag that - can be used to suppress the exception. For example:: - - except Exception: - with save_and_reraise_exception() as ctxt: - decide_if_need_reraise() - if not should_be_reraised: - ctxt.reraise = False - - If another exception occurs and reraise flag is False, - the saved exception will not be logged. - - If the caller wants to raise new exception during exception handling - he/she sets reraise to False initially with an ability to set it back to - True if needed:: - - except Exception: - with save_and_reraise_exception(reraise=False) as ctxt: - [if statements to determine whether to raise a new exception] - # Not raising a new exception, so reraise - ctxt.reraise = True - """ - def __init__(self, reraise=True): - self.reraise = reraise - - def __enter__(self): - self.type_, self.value, self.tb, = sys.exc_info() - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - if exc_type is not None: - if self.reraise: - logging.error(_LE('Original exception being dropped: %s'), - traceback.format_exception(self.type_, - self.value, - self.tb)) - return False - if self.reraise: - six.reraise(self.type_, self.value, self.tb) - - -def forever_retry_uncaught_exceptions(infunc): - def inner_func(*args, **kwargs): - last_log_time = 0 - last_exc_message = None - exc_count = 0 - while True: - try: - return infunc(*args, **kwargs) - except Exception as exc: - this_exc_message = six.u(str(exc)) - if this_exc_message == last_exc_message: - exc_count += 1 - else: - exc_count = 1 - # Do not log any more frequently than once a minute unless - # the exception message changes - cur_time = int(time.time()) - if (cur_time - last_log_time > 60 or - this_exc_message != last_exc_message): - logging.exception( - _LE('Unexpected exception occurred %d time(s)... ' - 'retrying.') % exc_count) - last_log_time = cur_time - last_exc_message = this_exc_message - exc_count = 0 - # This should be a very rare event. In case it isn't, do - # a sleep. - time.sleep(1) - return inner_func diff --git a/neutron/openstack/common/importutils.py b/neutron/openstack/common/importutils.py deleted file mode 100644 index 4038808ceb..0000000000 --- a/neutron/openstack/common/importutils.py +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 2011 OpenStack Foundation. -# 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. - -""" -Import related utilities and helper functions. -""" - -import sys -import traceback - - -def import_class(import_str): - """Returns a class from a string including module and class.""" - mod_str, _sep, class_str = import_str.rpartition('.') - __import__(mod_str) - try: - return getattr(sys.modules[mod_str], class_str) - except AttributeError: - raise ImportError('Class %s cannot be found (%s)' % - (class_str, - traceback.format_exception(*sys.exc_info()))) - - -def import_object(import_str, *args, **kwargs): - """Import a class and return an instance of it.""" - return import_class(import_str)(*args, **kwargs) - - -def import_object_ns(name_space, import_str, *args, **kwargs): - """Tries to import object from default namespace. - - Imports a class and return an instance of it, first by trying - to find the class in a default namespace, then failing back to - a full path if not found in the default namespace. - """ - import_value = "%s.%s" % (name_space, import_str) - try: - return import_class(import_value)(*args, **kwargs) - except ImportError: - return import_class(import_str)(*args, **kwargs) - - -def import_module(import_str): - """Import a module.""" - __import__(import_str) - return sys.modules[import_str] - - -def import_versioned_module(version, submodule=None): - module = 'neutron.v%s' % version - if submodule: - module = '.'.join((module, submodule)) - return import_module(module) - - -def try_import(import_str, default=None): - """Try to import a module and if it fails return default.""" - try: - return import_module(import_str) - except ImportError: - return default diff --git a/neutron/openstack/common/network_utils.py b/neutron/openstack/common/network_utils.py deleted file mode 100644 index d9640d15a6..0000000000 --- a/neutron/openstack/common/network_utils.py +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright 2012 OpenStack Foundation. -# 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. - -""" -Network-related utilities and helper functions. -""" - -# TODO(jd) Use six.moves once -# https://bitbucket.org/gutworth/six/pull-request/28 -# is merged -try: - import urllib.parse - SplitResult = urllib.parse.SplitResult -except ImportError: - import urlparse - SplitResult = urlparse.SplitResult - -from six.moves.urllib import parse - - -def parse_host_port(address, default_port=None): - """Interpret a string as a host:port pair. - - An IPv6 address MUST be escaped if accompanied by a port, - because otherwise ambiguity ensues: 2001:db8:85a3::8a2e:370:7334 - means both [2001:db8:85a3::8a2e:370:7334] and - [2001:db8:85a3::8a2e:370]:7334. - - >>> parse_host_port('server01:80') - ('server01', 80) - >>> parse_host_port('server01') - ('server01', None) - >>> parse_host_port('server01', default_port=1234) - ('server01', 1234) - >>> parse_host_port('[::1]:80') - ('::1', 80) - >>> parse_host_port('[::1]') - ('::1', None) - >>> parse_host_port('[::1]', default_port=1234) - ('::1', 1234) - >>> parse_host_port('2001:db8:85a3::8a2e:370:7334', default_port=1234) - ('2001:db8:85a3::8a2e:370:7334', 1234) - - """ - if address[0] == '[': - # Escaped ipv6 - _host, _port = address[1:].split(']') - host = _host - if ':' in _port: - port = _port.split(':')[1] - else: - port = default_port - else: - if address.count(':') == 1: - host, port = address.split(':') - else: - # 0 means ipv4, >1 means ipv6. - # We prohibit unescaped ipv6 addresses with port. - host = address - port = default_port - - return (host, None if port is None else int(port)) - - -def urlsplit(url, scheme='', allow_fragments=True): - """Parse a URL using urlparse.urlsplit(), splitting query and fragments. - This function papers over Python issue9374 when needed. - - The parameters are the same as urlparse.urlsplit. - """ - scheme, netloc, path, query, fragment = parse.urlsplit( - url, scheme, allow_fragments) - if allow_fragments and '#' in path: - path, fragment = path.split('#', 1) - if '?' in path: - path, query = path.split('?', 1) - return SplitResult(scheme, netloc, path, query, fragment) diff --git a/neutron/openstack/common/strutils.py b/neutron/openstack/common/strutils.py deleted file mode 100644 index 8c796d4f79..0000000000 --- a/neutron/openstack/common/strutils.py +++ /dev/null @@ -1,239 +0,0 @@ -# Copyright 2011 OpenStack Foundation. -# 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. - -""" -System-level utilities and helper functions. -""" - -import math -import re -import sys -import unicodedata - -import six - -from neutron.openstack.common.gettextutils import _ - - -UNIT_PREFIX_EXPONENT = { - 'k': 1, - 'K': 1, - 'Ki': 1, - 'M': 2, - 'Mi': 2, - 'G': 3, - 'Gi': 3, - 'T': 4, - 'Ti': 4, -} -UNIT_SYSTEM_INFO = { - 'IEC': (1024, re.compile(r'(^[-+]?\d*\.?\d+)([KMGT]i?)?(b|bit|B)$')), - 'SI': (1000, re.compile(r'(^[-+]?\d*\.?\d+)([kMGT])?(b|bit|B)$')), -} - -TRUE_STRINGS = ('1', 't', 'true', 'on', 'y', 'yes') -FALSE_STRINGS = ('0', 'f', 'false', 'off', 'n', 'no') - -SLUGIFY_STRIP_RE = re.compile(r"[^\w\s-]") -SLUGIFY_HYPHENATE_RE = re.compile(r"[-\s]+") - - -def int_from_bool_as_string(subject): - """Interpret a string as a boolean and return either 1 or 0. - - Any string value in: - - ('True', 'true', 'On', 'on', '1') - - is interpreted as a boolean True. - - Useful for JSON-decoded stuff and config file parsing - """ - return bool_from_string(subject) and 1 or 0 - - -def bool_from_string(subject, strict=False, default=False): - """Interpret a string as a boolean. - - A case-insensitive match is performed such that strings matching 't', - 'true', 'on', 'y', 'yes', or '1' are considered True and, when - `strict=False`, anything else returns the value specified by 'default'. - - Useful for JSON-decoded stuff and config file parsing. - - If `strict=True`, unrecognized values, including None, will raise a - ValueError which is useful when parsing values passed in from an API call. - Strings yielding False are 'f', 'false', 'off', 'n', 'no', or '0'. - """ - if not isinstance(subject, six.string_types): - subject = six.text_type(subject) - - lowered = subject.strip().lower() - - if lowered in TRUE_STRINGS: - return True - elif lowered in FALSE_STRINGS: - return False - elif strict: - acceptable = ', '.join( - "'%s'" % s for s in sorted(TRUE_STRINGS + FALSE_STRINGS)) - msg = _("Unrecognized value '%(val)s', acceptable values are:" - " %(acceptable)s") % {'val': subject, - 'acceptable': acceptable} - raise ValueError(msg) - else: - return default - - -def safe_decode(text, incoming=None, errors='strict'): - """Decodes incoming text/bytes string using `incoming` if they're not - already unicode. - - :param incoming: Text's current encoding - :param errors: Errors handling policy. See here for valid - values http://docs.python.org/2/library/codecs.html - :returns: text or a unicode `incoming` encoded - representation of it. - :raises TypeError: If text is not an instance of str - """ - if not isinstance(text, (six.string_types, six.binary_type)): - raise TypeError("%s can't be decoded" % type(text)) - - if isinstance(text, six.text_type): - return text - - if not incoming: - incoming = (sys.stdin.encoding or - sys.getdefaultencoding()) - - try: - return text.decode(incoming, errors) - except UnicodeDecodeError: - # Note(flaper87) If we get here, it means that - # sys.stdin.encoding / sys.getdefaultencoding - # didn't return a suitable encoding to decode - # text. This happens mostly when global LANG - # var is not set correctly and there's no - # default encoding. In this case, most likely - # python will use ASCII or ANSI encoders as - # default encodings but they won't be capable - # of decoding non-ASCII characters. - # - # Also, UTF-8 is being used since it's an ASCII - # extension. - return text.decode('utf-8', errors) - - -def safe_encode(text, incoming=None, - encoding='utf-8', errors='strict'): - """Encodes incoming text/bytes string using `encoding`. - - If incoming is not specified, text is expected to be encoded with - current python's default encoding. (`sys.getdefaultencoding`) - - :param incoming: Text's current encoding - :param encoding: Expected encoding for text (Default UTF-8) - :param errors: Errors handling policy. See here for valid - values http://docs.python.org/2/library/codecs.html - :returns: text or a bytestring `encoding` encoded - representation of it. - :raises TypeError: If text is not an instance of str - """ - if not isinstance(text, (six.string_types, six.binary_type)): - raise TypeError("%s can't be encoded" % type(text)) - - if not incoming: - incoming = (sys.stdin.encoding or - sys.getdefaultencoding()) - - if isinstance(text, six.text_type): - return text.encode(encoding, errors) - elif text and encoding != incoming: - # Decode text before encoding it with `encoding` - text = safe_decode(text, incoming, errors) - return text.encode(encoding, errors) - else: - return text - - -def string_to_bytes(text, unit_system='IEC', return_int=False): - """Converts a string into an float representation of bytes. - - The units supported for IEC :: - - Kb(it), Kib(it), Mb(it), Mib(it), Gb(it), Gib(it), Tb(it), Tib(it) - KB, KiB, MB, MiB, GB, GiB, TB, TiB - - The units supported for SI :: - - kb(it), Mb(it), Gb(it), Tb(it) - kB, MB, GB, TB - - Note that the SI unit system does not support capital letter 'K' - - :param text: String input for bytes size conversion. - :param unit_system: Unit system for byte size conversion. - :param return_int: If True, returns integer representation of text - in bytes. (default: decimal) - :returns: Numerical representation of text in bytes. - :raises ValueError: If text has an invalid value. - - """ - try: - base, reg_ex = UNIT_SYSTEM_INFO[unit_system] - except KeyError: - msg = _('Invalid unit system: "%s"') % unit_system - raise ValueError(msg) - match = reg_ex.match(text) - if match: - magnitude = float(match.group(1)) - unit_prefix = match.group(2) - if match.group(3) in ['b', 'bit']: - magnitude /= 8 - else: - msg = _('Invalid string format: %s') % text - raise ValueError(msg) - if not unit_prefix: - res = magnitude - else: - res = magnitude * pow(base, UNIT_PREFIX_EXPONENT[unit_prefix]) - if return_int: - return int(math.ceil(res)) - return res - - -def to_slug(value, incoming=None, errors="strict"): - """Normalize string. - - Convert to lowercase, remove non-word characters, and convert spaces - to hyphens. - - Inspired by Django's `slugify` filter. - - :param value: Text to slugify - :param incoming: Text's current encoding - :param errors: Errors handling policy. See here for valid - values http://docs.python.org/2/library/codecs.html - :returns: slugified unicode representation of `value` - :raises TypeError: If text is not an instance of str - """ - value = safe_decode(value, incoming, errors) - # NOTE(aababilov): no need to use safe_(encode|decode) here: - # encodings are always "ascii", error handling is always "ignore" - # and types are always known (first: unicode; second: str) - value = unicodedata.normalize("NFKD", value).encode( - "ascii", "ignore").decode("ascii") - value = SLUGIFY_STRIP_RE.sub("", value).strip().lower() - return SLUGIFY_HYPHENATE_RE.sub("-", value) diff --git a/neutron/openstack/common/timeutils.py b/neutron/openstack/common/timeutils.py deleted file mode 100644 index c48da95f12..0000000000 --- a/neutron/openstack/common/timeutils.py +++ /dev/null @@ -1,210 +0,0 @@ -# Copyright 2011 OpenStack Foundation. -# 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. - -""" -Time related utilities and helper functions. -""" - -import calendar -import datetime -import time - -import iso8601 -import six - - -# ISO 8601 extended time format with microseconds -_ISO8601_TIME_FORMAT_SUBSECOND = '%Y-%m-%dT%H:%M:%S.%f' -_ISO8601_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S' -PERFECT_TIME_FORMAT = _ISO8601_TIME_FORMAT_SUBSECOND - - -def isotime(at=None, subsecond=False): - """Stringify time in ISO 8601 format.""" - if not at: - at = utcnow() - st = at.strftime(_ISO8601_TIME_FORMAT - if not subsecond - else _ISO8601_TIME_FORMAT_SUBSECOND) - tz = at.tzinfo.tzname(None) if at.tzinfo else 'UTC' - st += ('Z' if tz == 'UTC' else tz) - return st - - -def parse_isotime(timestr): - """Parse time from ISO 8601 format.""" - try: - return iso8601.parse_date(timestr) - except iso8601.ParseError as e: - raise ValueError(six.text_type(e)) - except TypeError as e: - raise ValueError(six.text_type(e)) - - -def strtime(at=None, fmt=PERFECT_TIME_FORMAT): - """Returns formatted utcnow.""" - if not at: - at = utcnow() - return at.strftime(fmt) - - -def parse_strtime(timestr, fmt=PERFECT_TIME_FORMAT): - """Turn a formatted time back into a datetime.""" - return datetime.datetime.strptime(timestr, fmt) - - -def normalize_time(timestamp): - """Normalize time in arbitrary timezone to UTC naive object.""" - offset = timestamp.utcoffset() - if offset is None: - return timestamp - return timestamp.replace(tzinfo=None) - offset - - -def is_older_than(before, seconds): - """Return True if before is older than seconds.""" - if isinstance(before, six.string_types): - before = parse_strtime(before).replace(tzinfo=None) - else: - before = before.replace(tzinfo=None) - - return utcnow() - before > datetime.timedelta(seconds=seconds) - - -def is_newer_than(after, seconds): - """Return True if after is newer than seconds.""" - if isinstance(after, six.string_types): - after = parse_strtime(after).replace(tzinfo=None) - else: - after = after.replace(tzinfo=None) - - return after - utcnow() > datetime.timedelta(seconds=seconds) - - -def utcnow_ts(): - """Timestamp version of our utcnow function.""" - if utcnow.override_time is None: - # NOTE(kgriffs): This is several times faster - # than going through calendar.timegm(...) - return int(time.time()) - - return calendar.timegm(utcnow().timetuple()) - - -def utcnow(): - """Overridable version of utils.utcnow.""" - if utcnow.override_time: - try: - return utcnow.override_time.pop(0) - except AttributeError: - return utcnow.override_time - return datetime.datetime.utcnow() - - -def iso8601_from_timestamp(timestamp): - """Returns an iso8601 formatted date from timestamp.""" - return isotime(datetime.datetime.utcfromtimestamp(timestamp)) - - -utcnow.override_time = None - - -def set_time_override(override_time=None): - """Overrides utils.utcnow. - - Make it return a constant time or a list thereof, one at a time. - - :param override_time: datetime instance or list thereof. If not - given, defaults to the current UTC time. - """ - utcnow.override_time = override_time or datetime.datetime.utcnow() - - -def advance_time_delta(timedelta): - """Advance overridden time using a datetime.timedelta.""" - assert utcnow.override_time is not None - try: - for dt in utcnow.override_time: - dt += timedelta - except TypeError: - utcnow.override_time += timedelta - - -def advance_time_seconds(seconds): - """Advance overridden time by seconds.""" - advance_time_delta(datetime.timedelta(0, seconds)) - - -def clear_time_override(): - """Remove the overridden time.""" - utcnow.override_time = None - - -def marshall_now(now=None): - """Make an rpc-safe datetime with microseconds. - - Note: tzinfo is stripped, but not required for relative times. - """ - if not now: - now = utcnow() - return dict(day=now.day, month=now.month, year=now.year, hour=now.hour, - minute=now.minute, second=now.second, - microsecond=now.microsecond) - - -def unmarshall_time(tyme): - """Unmarshall a datetime dict.""" - return datetime.datetime(day=tyme['day'], - month=tyme['month'], - year=tyme['year'], - hour=tyme['hour'], - minute=tyme['minute'], - second=tyme['second'], - microsecond=tyme['microsecond']) - - -def delta_seconds(before, after): - """Return the difference between two timing objects. - - Compute the difference in seconds between two date, time, or - datetime objects (as a float, to microsecond resolution). - """ - delta = after - before - return total_seconds(delta) - - -def total_seconds(delta): - """Return the total seconds of datetime.timedelta object. - - Compute total seconds of datetime.timedelta, datetime.timedelta - doesn't have method total_seconds in Python2.6, calculate it manually. - """ - try: - return delta.total_seconds() - except AttributeError: - return ((delta.days * 24 * 3600) + delta.seconds + - float(delta.microseconds) / (10 ** 6)) - - -def is_soon(dt, window): - """Determines if time is going to happen in the next window seconds. - - :param dt: the time - :param window: minimum seconds to remain to consider the time not soon - - :return: True if expiration is within the given duration - """ - soon = (utcnow() + datetime.timedelta(seconds=window)) - return normalize_time(dt) <= soon diff --git a/neutron/plugins/bigswitch/agent/restproxy_agent.py b/neutron/plugins/bigswitch/agent/restproxy_agent.py index 910be06562..e528cb0828 100644 --- a/neutron/plugins/bigswitch/agent/restproxy_agent.py +++ b/neutron/plugins/bigswitch/agent/restproxy_agent.py @@ -23,6 +23,7 @@ import eventlet eventlet.monkey_patch() from oslo.config import cfg +from oslo.utils import excutils from neutron.agent.linux import ovs_lib from neutron.agent.linux import utils @@ -33,7 +34,6 @@ 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 -from neutron.openstack.common import excutils from neutron.openstack.common import log from neutron.plugins.bigswitch import config as pl_config diff --git a/neutron/plugins/bigswitch/l3_router_plugin.py b/neutron/plugins/bigswitch/l3_router_plugin.py index 2b2529e444..617ccec77d 100644 --- a/neutron/plugins/bigswitch/l3_router_plugin.py +++ b/neutron/plugins/bigswitch/l3_router_plugin.py @@ -23,6 +23,7 @@ Big Switch core plugin. """ from oslo.config import cfg +from oslo.utils import excutils from neutron.api import extensions as neutron_extensions from neutron.common import exceptions @@ -30,7 +31,6 @@ from neutron.common import log from neutron.common import utils from neutron.db import l3_db from neutron.extensions import l3 -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.bigswitch import extensions from neutron.plugins.bigswitch import plugin as cplugin diff --git a/neutron/plugins/bigswitch/plugin.py b/neutron/plugins/bigswitch/plugin.py index e3c4febc92..ba06b91131 100644 --- a/neutron/plugins/bigswitch/plugin.py +++ b/neutron/plugins/bigswitch/plugin.py @@ -48,6 +48,7 @@ import re import eventlet from oslo.config import cfg from oslo import messaging +from oslo.utils import importutils from sqlalchemy.orm import exc as sqlexc from neutron.agent import securitygroups_rpc as sg_rpc @@ -78,7 +79,6 @@ from neutron.extensions import external_net from neutron.extensions import extra_dhcp_opt as edo_ext from neutron.extensions import portbindings from neutron import manager -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.bigswitch import config as pl_config from neutron.plugins.bigswitch.db import porttracker_db diff --git a/neutron/plugins/bigswitch/servermanager.py b/neutron/plugins/bigswitch/servermanager.py index 8d91c7101c..2389c0671d 100644 --- a/neutron/plugins/bigswitch/servermanager.py +++ b/neutron/plugins/bigswitch/servermanager.py @@ -38,9 +38,9 @@ import eventlet import eventlet.corolocal from oslo.config import cfg from oslo.serialization import jsonutils +from oslo.utils import excutils from neutron.common import exceptions -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.bigswitch.db import consistency_db as cdb diff --git a/neutron/plugins/brocade/NeutronPlugin.py b/neutron/plugins/brocade/NeutronPlugin.py index 267c9ca7ee..4437c01283 100644 --- a/neutron/plugins/brocade/NeutronPlugin.py +++ b/neutron/plugins/brocade/NeutronPlugin.py @@ -21,6 +21,7 @@ from oslo.config import cfg from oslo import messaging +from oslo.utils import importutils from neutron.agent import securitygroups_rpc as sg_rpc from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api @@ -45,7 +46,6 @@ from neutron.db import securitygroups_rpc_base as sg_db_rpc from neutron.extensions import portbindings from neutron.extensions import securitygroup as ext_sg from neutron.openstack.common import context -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.brocade.db import models as brocade_db from neutron.plugins.brocade import vlanbm as vbm diff --git a/neutron/plugins/brocade/nos/nosdriver.py b/neutron/plugins/brocade/nos/nosdriver.py index fe09c0bf24..700516bbf4 100644 --- a/neutron/plugins/brocade/nos/nosdriver.py +++ b/neutron/plugins/brocade/nos/nosdriver.py @@ -19,8 +19,8 @@ Neutron network life-cycle management. """ from ncclient import manager +from oslo.utils import excutils -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.brocade.nos import nctemplates as template diff --git a/neutron/plugins/cisco/cfg_agent/cfg_agent.py b/neutron/plugins/cisco/cfg_agent/cfg_agent.py index 9563a903ad..3b600117cc 100644 --- a/neutron/plugins/cisco/cfg_agent/cfg_agent.py +++ b/neutron/plugins/cisco/cfg_agent/cfg_agent.py @@ -20,6 +20,8 @@ import time from oslo.config import cfg from oslo import messaging +from oslo.utils import importutils +from oslo.utils import timeutils from neutron.agent.common import config from neutron.agent.linux import external_process @@ -30,13 +32,11 @@ from neutron.common import rpc as n_rpc from neutron.common import topics from neutron import context as n_context from neutron import manager -from neutron.openstack.common import importutils from neutron.openstack.common import lockutils from neutron.openstack.common import log as logging from neutron.openstack.common import loopingcall from neutron.openstack.common import periodic_task from neutron.openstack.common import service -from neutron.openstack.common import timeutils from neutron.openstack.common.gettextutils import _LE, _LI, _LW from neutron.plugins.cisco.cfg_agent import device_status from neutron.plugins.cisco.common import cisco_constants as c_constants diff --git a/neutron/plugins/cisco/cfg_agent/device_drivers/driver_mgr.py b/neutron/plugins/cisco/cfg_agent/device_drivers/driver_mgr.py index 69a2e3cece..e74876ca02 100644 --- a/neutron/plugins/cisco/cfg_agent/device_drivers/driver_mgr.py +++ b/neutron/plugins/cisco/cfg_agent/device_drivers/driver_mgr.py @@ -12,9 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.openstack.common import excutils +from oslo.utils import excutils +from oslo.utils import importutils + from neutron.openstack.common.gettextutils import _LE -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.cisco.cfg_agent import cfg_exceptions diff --git a/neutron/plugins/cisco/cfg_agent/device_status.py b/neutron/plugins/cisco/cfg_agent/device_status.py index a41f8f4070..b6721eca55 100644 --- a/neutron/plugins/cisco/cfg_agent/device_status.py +++ b/neutron/plugins/cisco/cfg_agent/device_status.py @@ -15,10 +15,10 @@ import datetime from oslo.config import cfg +from oslo.utils import timeutils from neutron.agent.linux import utils as linux_utils from neutron.openstack.common import log as logging -from neutron.openstack.common import timeutils from neutron.openstack.common.gettextutils import _LI, _LW diff --git a/neutron/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py b/neutron/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py index 2dee6c44fb..fadab29de9 100644 --- a/neutron/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py +++ b/neutron/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py @@ -13,17 +13,17 @@ # under the License. import collections + import eventlet import netaddr - from oslo import messaging +from oslo.utils import excutils from neutron.common import constants as l3_constants 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 as n_context -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.openstack.common.gettextutils import _LE, _LI, _LW from neutron.plugins.cisco.cfg_agent import cfg_exceptions diff --git a/neutron/plugins/cisco/db/l3/device_handling_db.py b/neutron/plugins/cisco/db/l3/device_handling_db.py index c3fe25c52c..6eb0730add 100644 --- a/neutron/plugins/cisco/db/l3/device_handling_db.py +++ b/neutron/plugins/cisco/db/l3/device_handling_db.py @@ -17,6 +17,8 @@ import random from keystoneclient import exceptions as k_exceptions from keystoneclient.v2_0 import client as k_client from oslo.config import cfg +from oslo.utils import importutils +from oslo.utils import timeutils from sqlalchemy.orm import exc from sqlalchemy.orm import joinedload @@ -25,9 +27,7 @@ from neutron.common import utils from neutron import context as neutron_context from neutron.db import agents_db from neutron import manager -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging -from neutron.openstack.common import timeutils from neutron.openstack.common import uuidutils from neutron.openstack.common.gettextutils import _LE, _LI, _LW from neutron.plugins.cisco.common import cisco_constants as c_constants diff --git a/neutron/plugins/cisco/models/virt_phy_sw_v2.py b/neutron/plugins/cisco/models/virt_phy_sw_v2.py index 706ca00c61..91fd1a1369 100644 --- a/neutron/plugins/cisco/models/virt_phy_sw_v2.py +++ b/neutron/plugins/cisco/models/virt_phy_sw_v2.py @@ -15,13 +15,14 @@ import inspect +from oslo.utils import excutils +from oslo.utils import importutils + from neutron.api.v2 import attributes from neutron.extensions import portbindings from neutron.extensions import providernet as provider from neutron import neutron_plugin_base_v2 -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.cisco.common import cisco_constants as const from neutron.plugins.cisco.common import cisco_credentials_v2 as cred diff --git a/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py b/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py index 8bafe9a58d..947fdebb4d 100644 --- a/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py +++ b/neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py @@ -15,6 +15,8 @@ import eventlet from oslo.config import cfg as q_conf +from oslo.utils import excutils +from oslo.utils import importutils from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api from neutron.api.rpc.handlers import dhcp_rpc @@ -34,9 +36,7 @@ from neutron.db import quota_db from neutron.extensions import portbindings from neutron.extensions import providernet from neutron import manager -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LW -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.openstack.common import uuidutils as uuidutils from neutron.plugins.cisco.common import cisco_constants as c_const diff --git a/neutron/plugins/cisco/network_plugin.py b/neutron/plugins/cisco/network_plugin.py index e60da7987e..b8c48769fb 100644 --- a/neutron/plugins/cisco/network_plugin.py +++ b/neutron/plugins/cisco/network_plugin.py @@ -12,13 +12,12 @@ # License for the specific language governing permissions and limitations # under the License. - +from oslo.utils import importutils import webob.exc as wexc from neutron.api import extensions as neutron_extensions from neutron.api.v2 import base from neutron.db import db_base_plugin_v2 -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.cisco.common import cisco_exceptions as cexc from neutron.plugins.cisco.common import config diff --git a/neutron/plugins/ibm/sdnve_neutron_plugin.py b/neutron/plugins/ibm/sdnve_neutron_plugin.py index f90e18d8f4..9b3aa32cee 100644 --- a/neutron/plugins/ibm/sdnve_neutron_plugin.py +++ b/neutron/plugins/ibm/sdnve_neutron_plugin.py @@ -19,6 +19,7 @@ import functools from oslo.config import cfg from oslo import messaging +from oslo.utils import excutils from neutron.common import constants as n_const from neutron.common import exceptions as n_exc @@ -31,7 +32,6 @@ from neutron.db import l3_gwmode_db from neutron.db import portbindings_db from neutron.db import quota_db # noqa from neutron.extensions import portbindings -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.ibm.common import config # noqa from neutron.plugins.ibm.common import constants diff --git a/neutron/plugins/metaplugin/meta_neutron_plugin.py b/neutron/plugins/metaplugin/meta_neutron_plugin.py index d8fb71a33b..e956eaee68 100644 --- a/neutron/plugins/metaplugin/meta_neutron_plugin.py +++ b/neutron/plugins/metaplugin/meta_neutron_plugin.py @@ -14,6 +14,7 @@ # under the License. from oslo.config import cfg +from oslo.utils import importutils from neutron.common import exceptions as exc from neutron.common import topics @@ -24,7 +25,6 @@ from neutron.db import extraroute_db from neutron.db import l3_db from neutron.db import models_v2 from neutron.extensions import flavor as ext_flavor -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.metaplugin.common import config # noqa from neutron.plugins.metaplugin import meta_db_v2 diff --git a/neutron/plugins/midonet/plugin.py b/neutron/plugins/midonet/plugin.py index 5bfafb05a5..956e46b708 100644 --- a/neutron/plugins/midonet/plugin.py +++ b/neutron/plugins/midonet/plugin.py @@ -20,6 +20,7 @@ from midonetclient import api from midonetclient import exc from midonetclient.neutron import client as n_client from oslo.config import cfg +from oslo.utils import excutils from sqlalchemy.orm import exc as sa_exc from webob import exc as w_exc @@ -42,7 +43,6 @@ from neutron.extensions import external_net as ext_net from neutron.extensions import l3 from neutron.extensions import portbindings from neutron.extensions import securitygroup as ext_sg -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.midonet.common import config # noqa from neutron.plugins.midonet.common import net_util diff --git a/neutron/plugins/ml2/drivers/brocade/mechanism_brocade.py b/neutron/plugins/ml2/drivers/brocade/mechanism_brocade.py index 1cebdac443..e0b027bfc4 100644 --- a/neutron/plugins/ml2/drivers/brocade/mechanism_brocade.py +++ b/neutron/plugins/ml2/drivers/brocade/mechanism_brocade.py @@ -17,9 +17,9 @@ """Implentation of Brocade ML2 Mechanism driver for ML2 Plugin.""" from oslo.config import cfg +from oslo.utils import importutils from neutron.openstack.common.gettextutils import _LE, _LI -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.ml2 import driver_api from neutron.plugins.ml2.drivers.brocade.db import models as brocade_db diff --git a/neutron/plugins/ml2/drivers/brocade/nos/nosdriver.py b/neutron/plugins/ml2/drivers/brocade/nos/nosdriver.py index 53a3f265c9..afa41672c4 100644 --- a/neutron/plugins/ml2/drivers/brocade/nos/nosdriver.py +++ b/neutron/plugins/ml2/drivers/brocade/nos/nosdriver.py @@ -19,9 +19,9 @@ Neutron network life-cycle management. """ from ncclient import manager +from oslo.utils import excutils from xml.etree import ElementTree -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE from neutron.openstack.common import log as logging from neutron.plugins.ml2.drivers.brocade.nos import nctemplates as template diff --git a/neutron/plugins/ml2/drivers/cisco/nexus/nexus_network_driver.py b/neutron/plugins/ml2/drivers/cisco/nexus/nexus_network_driver.py index 18e9689ddb..826b4460bb 100644 --- a/neutron/plugins/ml2/drivers/cisco/nexus/nexus_network_driver.py +++ b/neutron/plugins/ml2/drivers/cisco/nexus/nexus_network_driver.py @@ -17,8 +17,9 @@ Implements a Nexus-OS NETCONF over SSHv2 API Client """ -from neutron.openstack.common import excutils -from neutron.openstack.common import importutils +from oslo.utils import excutils +from oslo.utils import importutils + from neutron.openstack.common import log as logging from neutron.plugins.ml2.drivers.cisco.nexus import config as conf from neutron.plugins.ml2.drivers.cisco.nexus import constants as const diff --git a/neutron/plugins/ml2/drivers/l2pop/db.py b/neutron/plugins/ml2/drivers/l2pop/db.py index d07d0b1af5..11f185b104 100644 --- a/neutron/plugins/ml2/drivers/l2pop/db.py +++ b/neutron/plugins/ml2/drivers/l2pop/db.py @@ -14,13 +14,13 @@ # under the License. from oslo.serialization import jsonutils +from oslo.utils import timeutils from sqlalchemy import sql from neutron.common import constants as const from neutron.db import agents_db from neutron.db import common_db_mixin as base_db from neutron.db import models_v2 -from neutron.openstack.common import timeutils from neutron.plugins.ml2.drivers.l2pop import constants as l2_const from neutron.plugins.ml2 import models as ml2_models diff --git a/neutron/plugins/ml2/drivers/mech_bigswitch/driver.py b/neutron/plugins/ml2/drivers/mech_bigswitch/driver.py index 61a8c5dddf..e292b33f89 100644 --- a/neutron/plugins/ml2/drivers/mech_bigswitch/driver.py +++ b/neutron/plugins/ml2/drivers/mech_bigswitch/driver.py @@ -18,13 +18,13 @@ import httplib import eventlet from oslo.config import cfg +from oslo.utils import excutils +from oslo.utils import timeutils from neutron import context as ctx from neutron.extensions import portbindings -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LW from neutron.openstack.common import log -from neutron.openstack.common import timeutils from neutron.plugins.bigswitch import config as pl_config from neutron.plugins.bigswitch import plugin from neutron.plugins.bigswitch import servermanager diff --git a/neutron/plugins/ml2/drivers/mechanism_odl.py b/neutron/plugins/ml2/drivers/mechanism_odl.py index 1b8b119bf0..487863d9a5 100644 --- a/neutron/plugins/ml2/drivers/mechanism_odl.py +++ b/neutron/plugins/ml2/drivers/mechanism_odl.py @@ -17,13 +17,13 @@ import time from oslo.config import cfg from oslo.serialization import jsonutils +from oslo.utils import excutils import requests from neutron.common import constants as n_const from neutron.common import exceptions as n_exc from neutron.common import utils from neutron.extensions import portbindings -from neutron.openstack.common import excutils from neutron.openstack.common import log from neutron.plugins.common import constants from neutron.plugins.ml2 import driver_api as api diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index 9e171dfcf8..c7587bf3ad 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -19,6 +19,8 @@ from eventlet import greenthread from oslo.config import cfg from oslo.db import exception as os_db_exception from oslo.serialization import jsonutils +from oslo.utils import excutils +from oslo.utils import importutils from sqlalchemy import exc as sql_exc from sqlalchemy.orm import exc as sa_exc @@ -52,9 +54,7 @@ from neutron.extensions import l3agentscheduler from neutron.extensions import portbindings from neutron.extensions import providernet as provider from neutron import manager -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI, _LW -from neutron.openstack.common import importutils from neutron.openstack.common import lockutils from neutron.openstack.common import log from neutron.openstack.common import uuidutils diff --git a/neutron/plugins/mlnx/agent/utils.py b/neutron/plugins/mlnx/agent/utils.py index 967f62b294..5a6bc8977b 100644 --- a/neutron/plugins/mlnx/agent/utils.py +++ b/neutron/plugins/mlnx/agent/utils.py @@ -14,8 +14,8 @@ # limitations under the License. from oslo.serialization import jsonutils +from oslo.utils import importutils -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.mlnx.common import comm_utils from neutron.plugins.mlnx.common import exceptions diff --git a/neutron/plugins/mlnx/mlnx_plugin.py b/neutron/plugins/mlnx/mlnx_plugin.py index f68437fbc5..4e0d718656 100644 --- a/neutron/plugins/mlnx/mlnx_plugin.py +++ b/neutron/plugins/mlnx/mlnx_plugin.py @@ -16,6 +16,7 @@ import sys from oslo.config import cfg +from oslo.utils import importutils from neutron.agent import securitygroups_rpc as sg_rpc from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api @@ -42,7 +43,6 @@ from neutron.db import quota_db # noqa from neutron.db import securitygroups_rpc_base as sg_db_rpc from neutron.extensions import portbindings from neutron.extensions import providernet as provider -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.common import constants as svc_constants from neutron.plugins.common import utils as plugin_utils diff --git a/neutron/plugins/nec/common/ofc_client.py b/neutron/plugins/nec/common/ofc_client.py index 1703763835..c48f52ffa7 100644 --- a/neutron/plugins/nec/common/ofc_client.py +++ b/neutron/plugins/nec/common/ofc_client.py @@ -15,9 +15,9 @@ import time from oslo.serialization import jsonutils +from oslo.utils import excutils import requests -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.nec.common import config from neutron.plugins.nec.common import exceptions as nexc diff --git a/neutron/plugins/nec/drivers/__init__.py b/neutron/plugins/nec/drivers/__init__.py index 7788ea7570..2b8a475de7 100644 --- a/neutron/plugins/nec/drivers/__init__.py +++ b/neutron/plugins/nec/drivers/__init__.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.openstack.common import importutils +from oslo.utils import importutils + from neutron.openstack.common import log as logging diff --git a/neutron/plugins/nec/nec_plugin.py b/neutron/plugins/nec/nec_plugin.py index 1845c688de..ad171c3138 100644 --- a/neutron/plugins/nec/nec_plugin.py +++ b/neutron/plugins/nec/nec_plugin.py @@ -13,6 +13,8 @@ # under the License. from oslo import messaging +from oslo.utils import excutils +from oslo.utils import importutils from neutron.agent import securitygroups_rpc as sg_rpc from neutron.api import extensions as neutron_extensions @@ -37,8 +39,6 @@ from neutron.db import quota_db # noqa from neutron.db import securitygroups_rpc_base as sg_db_rpc from neutron.extensions import allowedaddresspairs as addr_pair from neutron.extensions import portbindings -from neutron.openstack.common import excutils -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.openstack.common import uuidutils from neutron.plugins.common import constants as svc_constants diff --git a/neutron/plugins/nec/nec_router.py b/neutron/plugins/nec/nec_router.py index 5c4088ea78..42abc6ac5d 100644 --- a/neutron/plugins/nec/nec_router.py +++ b/neutron/plugins/nec/nec_router.py @@ -12,6 +12,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo.utils import excutils +from oslo.utils import importutils + from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api from neutron.api.v2 import attributes as attr from neutron.common import exceptions as n_exc @@ -22,8 +25,6 @@ from neutron.db import l3_db from neutron.db import l3_gwmode_db from neutron.db import models_v2 from neutron.extensions import l3 -from neutron.openstack.common import excutils -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.nec.common import config from neutron.plugins.nec.common import constants as nconst diff --git a/neutron/plugins/nec/packet_filter.py b/neutron/plugins/nec/packet_filter.py index 0b73dc783c..1f8a725c4e 100644 --- a/neutron/plugins/nec/packet_filter.py +++ b/neutron/plugins/nec/packet_filter.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.openstack.common import excutils +from oslo.utils import excutils + from neutron.openstack.common import log as logging from neutron.plugins.nec.common import config from neutron.plugins.nec.common import exceptions as nexc diff --git a/neutron/plugins/nec/router_drivers.py b/neutron/plugins/nec/router_drivers.py index 58c83e3390..250bd93ef7 100644 --- a/neutron/plugins/nec/router_drivers.py +++ b/neutron/plugins/nec/router_drivers.py @@ -15,11 +15,11 @@ import abc import httplib +from oslo.utils import excutils import six from neutron.common import log as call_log from neutron.common import utils -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.nec.common import constants as nconst from neutron.plugins.nec.common import exceptions as nexc diff --git a/neutron/plugins/nuage/plugin.py b/neutron/plugins/nuage/plugin.py index 995a8fa8d3..0da031d8b0 100644 --- a/neutron/plugins/nuage/plugin.py +++ b/neutron/plugins/nuage/plugin.py @@ -17,6 +17,8 @@ import re import netaddr from oslo.config import cfg +from oslo.utils import excutils +from oslo.utils import importutils from sqlalchemy.orm import exc from neutron.api import extensions as neutron_extensions @@ -36,8 +38,6 @@ from neutron.extensions import l3 from neutron.extensions import portbindings from neutron.extensions import providernet as pnet from neutron.extensions import securitygroup as ext_sg -from neutron.openstack.common import excutils -from neutron.openstack.common import importutils from neutron.openstack.common import lockutils from neutron.openstack.common import log as logging from neutron.openstack.common import loopingcall diff --git a/neutron/plugins/nuage/syncmanager.py b/neutron/plugins/nuage/syncmanager.py index 8656e15b05..517dcedcbf 100644 --- a/neutron/plugins/nuage/syncmanager.py +++ b/neutron/plugins/nuage/syncmanager.py @@ -14,13 +14,13 @@ # from oslo.config import cfg +from oslo.utils import importutils import sqlalchemy.orm.exc as db_exc from neutron import context as ncontext from neutron.db import db_base_plugin_v2 from neutron.db import extraroute_db from neutron.db import securitygroups_db -from neutron.openstack.common import importutils from neutron.openstack.common import log from neutron.openstack.common.gettextutils import _LE, _LI, _LW from neutron.plugins.nuage.common import config diff --git a/neutron/plugins/oneconvergence/lib/nvsdlib.py b/neutron/plugins/oneconvergence/lib/nvsdlib.py index e08a491e99..d66abe7953 100644 --- a/neutron/plugins/oneconvergence/lib/nvsdlib.py +++ b/neutron/plugins/oneconvergence/lib/nvsdlib.py @@ -15,8 +15,8 @@ """Intermidiate NVSD Library.""" from oslo.serialization import jsonutils +from oslo.utils import excutils -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging import neutron.plugins.oneconvergence.lib.exception as nvsdexception from neutron.plugins.oneconvergence.lib import plugin_helper diff --git a/neutron/plugins/oneconvergence/plugin.py b/neutron/plugins/oneconvergence/plugin.py index cd3b043654..5b612c6f83 100644 --- a/neutron/plugins/oneconvergence/plugin.py +++ b/neutron/plugins/oneconvergence/plugin.py @@ -15,6 +15,8 @@ """Implementation of OneConvergence Neutron Plugin.""" from oslo.config import cfg +from oslo.utils import excutils +from oslo.utils import importutils from neutron.agent import securitygroups_rpc as sg_rpc from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api @@ -38,8 +40,6 @@ from neutron.db import portbindings_base from neutron.db import quota_db # noqa from neutron.db import securitygroups_rpc_base as sg_db_rpc from neutron.extensions import portbindings -from neutron.openstack.common import excutils -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.common import constants as svc_constants import neutron.plugins.oneconvergence.lib.config # noqa diff --git a/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py b/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py index 3dfa020fab..4bf603f247 100644 --- a/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py +++ b/neutron/plugins/openvswitch/agent/ovs_dvr_neutron_agent.py @@ -15,11 +15,11 @@ from oslo import messaging +from oslo.utils import excutils from neutron.api.rpc.handlers import dvr_rpc from neutron.common import constants as n_const from neutron.common import utils as n_utils -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI, _LW from neutron.openstack.common import log as logging from neutron.plugins.openvswitch.common import constants diff --git a/neutron/plugins/plumgrid/plumgrid_plugin/plumgrid_plugin.py b/neutron/plugins/plumgrid/plumgrid_plugin/plumgrid_plugin.py index e132cc266d..b879f6dfd3 100644 --- a/neutron/plugins/plumgrid/plumgrid_plugin/plumgrid_plugin.py +++ b/neutron/plugins/plumgrid/plumgrid_plugin/plumgrid_plugin.py @@ -20,6 +20,7 @@ to the PLUMgrid Network Management System called Director import netaddr from oslo.config import cfg +from oslo.utils import importutils from sqlalchemy.orm import exc as sa_exc from neutron.api.v2 import attributes @@ -32,7 +33,6 @@ from neutron.db import quota_db # noqa from neutron.db import securitygroups_db from neutron.extensions import portbindings from neutron.extensions import securitygroup as sec_grp -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.plumgrid.common import exceptions as plum_excep from neutron.plugins.plumgrid.plumgrid_plugin import plugin_ver diff --git a/neutron/plugins/vmware/api_client/request.py b/neutron/plugins/vmware/api_client/request.py index bfc80fcbca..78cf81f562 100644 --- a/neutron/plugins/vmware/api_client/request.py +++ b/neutron/plugins/vmware/api_client/request.py @@ -17,14 +17,14 @@ import abc import copy -import eventlet import httplib import time +import eventlet +from oslo.utils import excutils import six import six.moves.urllib.parse as urlparse -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.vmware import api_client diff --git a/neutron/plugins/vmware/common/sync.py b/neutron/plugins/vmware/common/sync.py index 42c7495565..c7621a79b6 100644 --- a/neutron/plugins/vmware/common/sync.py +++ b/neutron/plugins/vmware/common/sync.py @@ -16,6 +16,7 @@ import random from oslo.serialization import jsonutils +from oslo.utils import timeutils from neutron.common import constants from neutron.common import exceptions @@ -26,7 +27,6 @@ from neutron.db import models_v2 from neutron.extensions import l3 from neutron.openstack.common import log from neutron.openstack.common import loopingcall -from neutron.openstack.common import timeutils from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.common import exceptions as nsx_exc from neutron.plugins.vmware.common import nsx_utils diff --git a/neutron/plugins/vmware/dbexts/db.py b/neutron/plugins/vmware/dbexts/db.py index 37dd6a77f7..55f2bb0588 100644 --- a/neutron/plugins/vmware/dbexts/db.py +++ b/neutron/plugins/vmware/dbexts/db.py @@ -15,10 +15,10 @@ # under the License. from oslo.db import exception as db_exc +from oslo.utils import excutils from sqlalchemy.orm import exc import neutron.db.api as db -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.vmware.dbexts import models from neutron.plugins.vmware.dbexts import networkgw_db diff --git a/neutron/plugins/vmware/dhcp_meta/lsnmanager.py b/neutron/plugins/vmware/dhcp_meta/lsnmanager.py index 4c61a93a8c..9d861329da 100644 --- a/neutron/plugins/vmware/dhcp_meta/lsnmanager.py +++ b/neutron/plugins/vmware/dhcp_meta/lsnmanager.py @@ -17,9 +17,9 @@ from oslo.config import cfg from oslo.db import exception as db_exc +from oslo.utils import excutils from neutron.common import exceptions as n_exc -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.common import exceptions as p_exc diff --git a/neutron/plugins/vmware/dhcp_meta/nsx.py b/neutron/plugins/vmware/dhcp_meta/nsx.py index 5c1f3971af..b26960b470 100644 --- a/neutron/plugins/vmware/dhcp_meta/nsx.py +++ b/neutron/plugins/vmware/dhcp_meta/nsx.py @@ -16,6 +16,7 @@ # from oslo.config import cfg +from oslo.utils import excutils from neutron.api.v2 import attributes as attr from neutron.common import constants as const @@ -23,7 +24,6 @@ from neutron.common import exceptions as n_exc from neutron.db import db_base_plugin_v2 from neutron.db import l3_db from neutron.extensions import external_net -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.vmware.common import exceptions as p_exc from neutron.plugins.vmware.dhcp_meta import constants as d_const diff --git a/neutron/plugins/vmware/dhcpmeta_modes.py b/neutron/plugins/vmware/dhcpmeta_modes.py index 32b66d16dd..addc718785 100644 --- a/neutron/plugins/vmware/dhcpmeta_modes.py +++ b/neutron/plugins/vmware/dhcpmeta_modes.py @@ -16,6 +16,7 @@ # from oslo.config import cfg +from oslo.utils import importutils from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api from neutron.api.rpc.handlers import dhcp_rpc @@ -24,7 +25,6 @@ from neutron.common import constants as const 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 from neutron.openstack.common import log as logging from neutron.plugins.vmware.common import config from neutron.plugins.vmware.common import exceptions as nsx_exc diff --git a/neutron/plugins/vmware/nsxlib/queue.py b/neutron/plugins/vmware/nsxlib/queue.py index 791e8f1397..ac2f4df4d6 100644 --- a/neutron/plugins/vmware/nsxlib/queue.py +++ b/neutron/plugins/vmware/nsxlib/queue.py @@ -14,10 +14,10 @@ # under the License. from oslo.serialization import jsonutils +from oslo.utils import excutils from neutron.api.v2 import attributes as attr from neutron.common import exceptions as exception -from neutron.openstack.common import excutils from neutron.openstack.common import log from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.common import utils diff --git a/neutron/plugins/vmware/nsxlib/router.py b/neutron/plugins/vmware/nsxlib/router.py index cd8fd494e6..95a29ae520 100644 --- a/neutron/plugins/vmware/nsxlib/router.py +++ b/neutron/plugins/vmware/nsxlib/router.py @@ -15,9 +15,9 @@ from oslo.config import cfg from oslo.serialization import jsonutils +from oslo.utils import excutils from neutron.common import exceptions as exception -from neutron.openstack.common import excutils from neutron.openstack.common import log from neutron.plugins.vmware.api_client import exception as api_exc from neutron.plugins.vmware.common import exceptions as nsx_exc diff --git a/neutron/plugins/vmware/nsxlib/secgroup.py b/neutron/plugins/vmware/nsxlib/secgroup.py index c380aa7224..91e4f5631c 100644 --- a/neutron/plugins/vmware/nsxlib/secgroup.py +++ b/neutron/plugins/vmware/nsxlib/secgroup.py @@ -14,10 +14,10 @@ # under the License. from oslo.serialization import jsonutils +from oslo.utils import excutils from neutron.common import constants from neutron.common import exceptions -from neutron.openstack.common import excutils from neutron.openstack.common import log from neutron.plugins.vmware.common import utils from neutron.plugins.vmware import nsxlib diff --git a/neutron/plugins/vmware/plugins/base.py b/neutron/plugins/vmware/plugins/base.py index 9b1f95a5ee..c28a940d0e 100644 --- a/neutron/plugins/vmware/plugins/base.py +++ b/neutron/plugins/vmware/plugins/base.py @@ -17,6 +17,7 @@ import uuid from oslo.config import cfg from oslo.db import exception as db_exc +from oslo.utils import excutils from sqlalchemy import exc as sql_exc from sqlalchemy.orm import exc as sa_exc import webob.exc @@ -50,7 +51,6 @@ from neutron.extensions import portbindings as pbin from neutron.extensions import portsecurity as psec from neutron.extensions import providernet as pnet from neutron.extensions import securitygroup as ext_sg -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE from neutron.openstack.common import lockutils from neutron.openstack.common import log as logging diff --git a/neutron/plugins/vmware/plugins/service.py b/neutron/plugins/vmware/plugins/service.py index d7e32e2f22..32299b3337 100644 --- a/neutron/plugins/vmware/plugins/service.py +++ b/neutron/plugins/vmware/plugins/service.py @@ -16,6 +16,7 @@ import netaddr from oslo.config import cfg +from oslo.utils import excutils from neutron.common import constants from neutron.common import exceptions as n_exc @@ -28,7 +29,6 @@ from neutron.extensions import firewall as fw_ext from neutron.extensions import l3 from neutron.extensions import routedserviceinsertion as rsi from neutron.extensions import vpnaas as vpn_ext -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.common import constants as service_constants from neutron.plugins.vmware.api_client import exception as api_exc diff --git a/neutron/plugins/vmware/vshield/edge_appliance_driver.py b/neutron/plugins/vmware/vshield/edge_appliance_driver.py index a97c5d49a6..c9f59ec616 100644 --- a/neutron/plugins/vmware/vshield/edge_appliance_driver.py +++ b/neutron/plugins/vmware/vshield/edge_appliance_driver.py @@ -13,8 +13,8 @@ # under the License. from oslo.serialization import jsonutils +from oslo.utils import excutils -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.vmware.common import utils from neutron.plugins.vmware.vshield.common import constants as vcns_const diff --git a/neutron/plugins/vmware/vshield/edge_firewall_driver.py b/neutron/plugins/vmware/vshield/edge_firewall_driver.py index 09b618cbac..ad99851684 100644 --- a/neutron/plugins/vmware/vshield/edge_firewall_driver.py +++ b/neutron/plugins/vmware/vshield/edge_firewall_driver.py @@ -12,8 +12,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo.utils import excutils + from neutron.db import db_base_plugin_v2 -from neutron.openstack.common import excutils from neutron.openstack.common import log as logging from neutron.plugins.common import constants from neutron.plugins.vmware.dbexts import vcns_db diff --git a/neutron/plugins/vmware/vshield/edge_ipsecvpn_driver.py b/neutron/plugins/vmware/vshield/edge_ipsecvpn_driver.py index 7e74fe1f87..6ae188910b 100644 --- a/neutron/plugins/vmware/vshield/edge_ipsecvpn_driver.py +++ b/neutron/plugins/vmware/vshield/edge_ipsecvpn_driver.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.openstack.common import excutils +from oslo.utils import excutils + from neutron.openstack.common import log as logging from neutron.plugins.vmware.vshield.common import ( exceptions as vcns_exc) diff --git a/neutron/plugins/vmware/vshield/edge_loadbalancer_driver.py b/neutron/plugins/vmware/vshield/edge_loadbalancer_driver.py index faad6e889c..1b3ce55bd3 100644 --- a/neutron/plugins/vmware/vshield/edge_loadbalancer_driver.py +++ b/neutron/plugins/vmware/vshield/edge_loadbalancer_driver.py @@ -12,7 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from neutron.openstack.common import excutils +from oslo.utils import excutils + from neutron.openstack.common import log as logging from neutron.plugins.vmware.dbexts import vcns_db from neutron.plugins.vmware.vshield.common import ( diff --git a/neutron/policy.py b/neutron/policy.py index 3ca112a077..de64cc943f 100644 --- a/neutron/policy.py +++ b/neutron/policy.py @@ -23,14 +23,14 @@ import logging import re from oslo.config import cfg +from oslo.utils import excutils +from oslo.utils import importutils from neutron.api.v2 import attributes from neutron.common import constants as const from neutron.common import exceptions import neutron.common.utils as utils -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI, _LW -from neutron.openstack.common import importutils from neutron.openstack.common import log from neutron.openstack.common import policy diff --git a/neutron/quota.py b/neutron/quota.py index 3fc07a326c..fbac9c12e9 100644 --- a/neutron/quota.py +++ b/neutron/quota.py @@ -17,10 +17,10 @@ import sys from oslo.config import cfg +from oslo.utils import importutils import webob from neutron.common import exceptions -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/neutron/service.py b/neutron/service.py index 1761bacc45..c72e5e5b42 100644 --- a/neutron/service.py +++ b/neutron/service.py @@ -20,14 +20,14 @@ import random from oslo.config import cfg from oslo.messaging import server as rpc_server +from oslo.utils import excutils +from oslo.utils import importutils from neutron.common import config from neutron.common import rpc as n_rpc from neutron import context from neutron.db import api as session from neutron import manager -from neutron.openstack.common import excutils -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.openstack.common import loopingcall from neutron.openstack.common import service as common_service diff --git a/neutron/services/firewall/agents/l3reference/firewall_l3_agent.py b/neutron/services/firewall/agents/l3reference/firewall_l3_agent.py index 67b9324ad5..e5f43568ae 100644 --- a/neutron/services/firewall/agents/l3reference/firewall_l3_agent.py +++ b/neutron/services/firewall/agents/l3reference/firewall_l3_agent.py @@ -14,6 +14,7 @@ # under the License. from oslo.config import cfg +from oslo.utils import importutils from neutron.agent.common import config from neutron.agent.linux import ip_lib @@ -21,7 +22,6 @@ from neutron.common import topics from neutron import context from neutron.extensions import firewall as fw_ext from neutron.openstack.common.gettextutils import _LE -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.common import constants from neutron.services.firewall.agents import firewall_agent_api as api diff --git a/neutron/services/l3_router/brocade/l3_router_plugin.py b/neutron/services/l3_router/brocade/l3_router_plugin.py index 079e6fc681..141aed1e6d 100644 --- a/neutron/services/l3_router/brocade/l3_router_plugin.py +++ b/neutron/services/l3_router/brocade/l3_router_plugin.py @@ -18,9 +18,9 @@ """Implentation of Brocade SVI service Plugin.""" from oslo.config import cfg +from oslo.utils import excutils from neutron.common import constants as l3_constants -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI from neutron.openstack.common import log as logging from neutron.plugins.ml2 import db diff --git a/neutron/services/l3_router/l3_apic.py b/neutron/services/l3_router/l3_apic.py index 18896b50f5..c4139a6510 100644 --- a/neutron/services/l3_router/l3_apic.py +++ b/neutron/services/l3_router/l3_apic.py @@ -14,11 +14,11 @@ # under the License. from apicapi import apic_mapper +from oslo.utils import excutils from neutron.db import db_base_plugin_v2 from neutron.db import extraroute_db from neutron.db import l3_dvr_db -from neutron.openstack.common import excutils from neutron.plugins.common import constants from neutron.plugins.ml2.drivers.cisco.apic import mechanism_apic diff --git a/neutron/services/l3_router/l3_arista.py b/neutron/services/l3_router/l3_arista.py index f1c12d7e34..4206066d33 100644 --- a/neutron/services/l3_router/l3_arista.py +++ b/neutron/services/l3_router/l3_arista.py @@ -16,6 +16,7 @@ import copy import threading from oslo.config import cfg +from oslo.utils import excutils from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api from neutron.api.rpc.handlers import l3_rpc @@ -28,7 +29,6 @@ from neutron.db import db_base_plugin_v2 from neutron.db import extraroute_db from neutron.db import l3_agentschedulers_db from neutron.db import l3_gwmode_db -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI from neutron.openstack.common import log as logging from neutron.plugins.common import constants diff --git a/neutron/services/l3_router/l3_router_plugin.py b/neutron/services/l3_router/l3_router_plugin.py index 4ebd9224b7..117a99080b 100644 --- a/neutron/services/l3_router/l3_router_plugin.py +++ b/neutron/services/l3_router/l3_router_plugin.py @@ -14,6 +14,7 @@ # under the License. from oslo.config import cfg +from oslo.utils import importutils from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api from neutron.api.rpc.handlers import l3_rpc @@ -26,7 +27,6 @@ from neutron.db import l3_dvrscheduler_db from neutron.db import l3_gwmode_db from neutron.db import l3_hamode_db from neutron.db import l3_hascheduler_db -from neutron.openstack.common import importutils from neutron.plugins.common import constants diff --git a/neutron/services/loadbalancer/agent/agent_manager.py b/neutron/services/loadbalancer/agent/agent_manager.py index 94b439b074..efa91b222d 100644 --- a/neutron/services/loadbalancer/agent/agent_manager.py +++ b/neutron/services/loadbalancer/agent/agent_manager.py @@ -13,6 +13,7 @@ # under the License. from oslo.config import cfg +from oslo.utils import importutils from neutron.agent import rpc as agent_rpc from neutron.common import constants as n_const @@ -21,7 +22,6 @@ from neutron.common import rpc as n_rpc from neutron.common import topics from neutron import context from neutron.openstack.common.gettextutils import _LE, _LI -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.openstack.common import loopingcall from neutron.openstack.common import periodic_task diff --git a/neutron/services/loadbalancer/drivers/common/agent_driver_base.py b/neutron/services/loadbalancer/drivers/common/agent_driver_base.py index c9d3d0bd37..3a8bd44566 100644 --- a/neutron/services/loadbalancer/drivers/common/agent_driver_base.py +++ b/neutron/services/loadbalancer/drivers/common/agent_driver_base.py @@ -16,6 +16,7 @@ import uuid from oslo.config import cfg from oslo import messaging +from oslo.utils import importutils from neutron.common import constants as q_const from neutron.common import exceptions as n_exc @@ -26,7 +27,6 @@ from neutron.db.loadbalancer import loadbalancer_db from neutron.extensions import lbaas_agentscheduler from neutron.extensions import portbindings from neutron.openstack.common.gettextutils import _LW -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.common import constants from neutron.services.loadbalancer.drivers import abstract_driver diff --git a/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py b/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py index a2ff329d32..f243173b4b 100644 --- a/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py +++ b/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py @@ -18,15 +18,15 @@ import socket import netaddr from oslo.config import cfg +from oslo.utils import excutils +from oslo.utils import importutils from neutron.agent.common import config from neutron.agent.linux import ip_lib from neutron.agent.linux import utils from neutron.common import exceptions from neutron.common import utils as n_utils -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LW -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.common import constants from neutron.services.loadbalancer.agent import agent_device_driver diff --git a/neutron/services/loadbalancer/drivers/radware/driver.py b/neutron/services/loadbalancer/drivers/radware/driver.py index 8eeaea4cca..4355a72294 100644 --- a/neutron/services/loadbalancer/drivers/radware/driver.py +++ b/neutron/services/loadbalancer/drivers/radware/driver.py @@ -25,6 +25,7 @@ eventlet.monkey_patch(thread=True) from oslo.config import cfg from oslo.serialization import jsonutils +from oslo.utils import excutils from six.moves import queue as Queue from neutron.api.v2 import attributes @@ -32,7 +33,6 @@ from neutron.common import log as call_log from neutron import context from neutron.db.loadbalancer import loadbalancer_db as lb_db from neutron.extensions import loadbalancer -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI, _LW from neutron.openstack.common import log as logging from neutron.plugins.common import constants diff --git a/neutron/services/loadbalancer/plugin.py b/neutron/services/loadbalancer/plugin.py index 14a1cda54e..d0006f4f69 100644 --- a/neutron/services/loadbalancer/plugin.py +++ b/neutron/services/loadbalancer/plugin.py @@ -13,13 +13,14 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo.utils import excutils + from neutron.api.v2 import attributes as attrs from neutron.common import exceptions as n_exc from neutron import context from neutron.db.loadbalancer import loadbalancer_db as ldb from neutron.db import servicetype_db as st_db from neutron.extensions import loadbalancer -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE from neutron.openstack.common import log as logging from neutron.plugins.common import constants diff --git a/neutron/services/metering/agents/metering_agent.py b/neutron/services/metering/agents/metering_agent.py index 75eca17ccc..21f5c6e707 100644 --- a/neutron/services/metering/agents/metering_agent.py +++ b/neutron/services/metering/agents/metering_agent.py @@ -20,6 +20,7 @@ eventlet.monkey_patch() from oslo.config import cfg from oslo import messaging +from oslo.utils import importutils from neutron.agent.common import config from neutron.agent import rpc as agent_rpc @@ -31,7 +32,6 @@ from neutron.common import utils from neutron import context from neutron import manager from neutron.openstack.common.gettextutils import _LE, _LI, _LW -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.openstack.common import loopingcall from neutron.openstack.common import periodic_task diff --git a/neutron/services/metering/drivers/iptables/iptables_driver.py b/neutron/services/metering/drivers/iptables/iptables_driver.py index aed58028dc..8741c72cf8 100644 --- a/neutron/services/metering/drivers/iptables/iptables_driver.py +++ b/neutron/services/metering/drivers/iptables/iptables_driver.py @@ -13,6 +13,7 @@ # under the License. from oslo.config import cfg +from oslo.utils import importutils import six from neutron.agent.common import config @@ -22,7 +23,6 @@ from neutron.common import constants as constants from neutron.common import ipv6_utils from neutron.common import log from neutron.openstack.common.gettextutils import _LI -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.services.metering.drivers import abstract_driver diff --git a/neutron/services/service_base.py b/neutron/services/service_base.py index 6b4f442439..f8139c6101 100644 --- a/neutron/services/service_base.py +++ b/neutron/services/service_base.py @@ -15,13 +15,13 @@ import abc +from oslo.utils import excutils +from oslo.utils import importutils import six from neutron.api import extensions from neutron.db import servicetype_db as sdb -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE, _LI -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.services import provider_configuration as pconf diff --git a/neutron/services/vpn/agent.py b/neutron/services/vpn/agent.py index 6f67ccf1f0..62807bb174 100644 --- a/neutron/services/vpn/agent.py +++ b/neutron/services/vpn/agent.py @@ -12,11 +12,12 @@ # 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.utils import importutils from neutron.agent import l3_agent from neutron.extensions import vpnaas -from neutron.openstack.common import importutils vpn_agent_opts = [ cfg.MultiStrOpt( diff --git a/neutron/tests/functional/agent/linux/test_ip_lib.py b/neutron/tests/functional/agent/linux/test_ip_lib.py index f0b42150f8..5abc4c80cc 100644 --- a/neutron/tests/functional/agent/linux/test_ip_lib.py +++ b/neutron/tests/functional/agent/linux/test_ip_lib.py @@ -16,12 +16,12 @@ import collections from oslo.config import cfg +from oslo.utils import importutils from neutron.agent.common import config from neutron.agent.linux import interface from neutron.agent.linux import ip_lib from neutron.common import utils -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.tests.functional.agent.linux import base diff --git a/neutron/tests/unit/api/rpc/agentnotifiers/test_dhcp_rpc_agent_api.py b/neutron/tests/unit/api/rpc/agentnotifiers/test_dhcp_rpc_agent_api.py index 6df1bbf9c7..df6198c8fd 100644 --- a/neutron/tests/unit/api/rpc/agentnotifiers/test_dhcp_rpc_agent_api.py +++ b/neutron/tests/unit/api/rpc/agentnotifiers/test_dhcp_rpc_agent_api.py @@ -16,10 +16,11 @@ import datetime import mock +from oslo.utils import timeutils + from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api from neutron.common import utils from neutron.db import agents_db -from neutron.openstack.common import timeutils from neutron.tests import base diff --git a/neutron/tests/unit/bigswitch/test_restproxy_agent.py b/neutron/tests/unit/bigswitch/test_restproxy_agent.py index f7d9009ed5..7dd710eab5 100644 --- a/neutron/tests/unit/bigswitch/test_restproxy_agent.py +++ b/neutron/tests/unit/bigswitch/test_restproxy_agent.py @@ -16,8 +16,8 @@ import contextlib import mock +from oslo.utils import importutils -from neutron.openstack.common import importutils from neutron.tests import base OVSBRIDGE = 'neutron.agent.linux.ovs_lib.OVSBridge' diff --git a/neutron/tests/unit/bigswitch/test_servermanager.py b/neutron/tests/unit/bigswitch/test_servermanager.py index 3b2aa8cd04..ffb7ee991b 100644 --- a/neutron/tests/unit/bigswitch/test_servermanager.py +++ b/neutron/tests/unit/bigswitch/test_servermanager.py @@ -20,10 +20,10 @@ import mock from oslo.config import cfg from oslo.db import exception as db_exc from oslo.serialization import jsonutils +from oslo.utils import importutils from neutron import context from neutron import manager -from neutron.openstack.common import importutils from neutron.plugins.bigswitch.db import consistency_db from neutron.plugins.bigswitch import servermanager from neutron.tests.unit.bigswitch import test_restproxy_plugin as test_rp diff --git a/neutron/tests/unit/brocade/test_brocade_plugin.py b/neutron/tests/unit/brocade/test_brocade_plugin.py index 0e3a6ef69d..b93e996854 100644 --- a/neutron/tests/unit/brocade/test_brocade_plugin.py +++ b/neutron/tests/unit/brocade/test_brocade_plugin.py @@ -15,9 +15,9 @@ import mock +from oslo.utils import importutils from neutron.extensions import portbindings -from neutron.openstack.common import importutils from neutron.plugins.brocade import NeutronPlugin as brocade_plugin from neutron.tests.unit import _test_extension_portbindings as test_bindings from neutron.tests.unit import test_db_plugin as test_plugin diff --git a/neutron/tests/unit/cisco/l3/device_handling_test_support.py b/neutron/tests/unit/cisco/l3/device_handling_test_support.py index 1bcbc6a29a..91f5c8394e 100644 --- a/neutron/tests/unit/cisco/l3/device_handling_test_support.py +++ b/neutron/tests/unit/cisco/l3/device_handling_test_support.py @@ -15,10 +15,10 @@ import mock from novaclient import exceptions as nova_exc from oslo.config import cfg +from oslo.utils import excutils from neutron import context as n_context from neutron import manager -from neutron.openstack.common import excutils from neutron.openstack.common.gettextutils import _LE from neutron.openstack.common import log as logging from neutron.openstack.common import uuidutils diff --git a/neutron/tests/unit/cisco/l3/test_l3_router_appliance_plugin.py b/neutron/tests/unit/cisco/l3/test_l3_router_appliance_plugin.py index b926b76be5..00e2336bd6 100644 --- a/neutron/tests/unit/cisco/l3/test_l3_router_appliance_plugin.py +++ b/neutron/tests/unit/cisco/l3/test_l3_router_appliance_plugin.py @@ -14,6 +14,7 @@ import mock from oslo.config import cfg +from oslo.utils import timeutils from webob import exc import neutron @@ -23,7 +24,6 @@ from neutron.db import agents_db from neutron.db import common_db_mixin from neutron.extensions import providernet as pnet from neutron import manager -from neutron.openstack.common import timeutils from neutron.plugins.cisco.common import cisco_constants as c_constants from neutron.plugins.cisco.db.l3 import device_handling_db from neutron.plugins.cisco.db.l3 import l3_router_appliance_db diff --git a/neutron/tests/unit/db/firewall/test_db_firewall.py b/neutron/tests/unit/db/firewall/test_db_firewall.py index 64f2365071..fbb37ad12e 100644 --- a/neutron/tests/unit/db/firewall/test_db_firewall.py +++ b/neutron/tests/unit/db/firewall/test_db_firewall.py @@ -18,6 +18,7 @@ from oslo.config import cfg import contextlib import mock +from oslo.utils import importutils import webob.exc from neutron.api import extensions as api_ext @@ -27,7 +28,6 @@ from neutron.db.firewall import firewall_db as fdb import neutron.extensions from neutron.extensions import firewall from neutron import manager -from neutron.openstack.common import importutils from neutron.openstack.common import uuidutils from neutron.plugins.common import constants from neutron.services.firewall import fwaas_plugin diff --git a/neutron/tests/unit/db/test_agent_db.py b/neutron/tests/unit/db/test_agent_db.py index b2db78b206..b0a1daef35 100644 --- a/neutron/tests/unit/db/test_agent_db.py +++ b/neutron/tests/unit/db/test_agent_db.py @@ -15,12 +15,12 @@ import mock from oslo.db import exception as exc +from oslo.utils import timeutils from neutron.common import constants from neutron import context from neutron.db import agents_db from neutron.db import db_base_plugin_v2 as base_plugin -from neutron.openstack.common import timeutils from neutron.tests.unit import testlib_api diff --git a/neutron/tests/unit/ml2/drivers/brocade/test_brocade_l3_plugin.py b/neutron/tests/unit/ml2/drivers/brocade/test_brocade_l3_plugin.py index ec8bc5f510..2dd1abfef7 100644 --- a/neutron/tests/unit/ml2/drivers/brocade/test_brocade_l3_plugin.py +++ b/neutron/tests/unit/ml2/drivers/brocade/test_brocade_l3_plugin.py @@ -17,10 +17,10 @@ import mock from oslo.config import cfg +from oslo.utils import importutils from neutron.db import api as db from neutron.openstack.common import context -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.tests.unit import test_l3_plugin diff --git a/neutron/tests/unit/ml2/drivers/brocade/test_brocade_mechanism_driver.py b/neutron/tests/unit/ml2/drivers/brocade/test_brocade_mechanism_driver.py index 5eea451d14..b8cbb5ff55 100644 --- a/neutron/tests/unit/ml2/drivers/brocade/test_brocade_mechanism_driver.py +++ b/neutron/tests/unit/ml2/drivers/brocade/test_brocade_mechanism_driver.py @@ -14,8 +14,8 @@ # limitations under the License. import mock +from oslo.utils import importutils -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.plugins.ml2 import config as ml2_config from neutron.plugins.ml2.drivers.brocade import (mechanism_brocade diff --git a/neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_nexus.py b/neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_nexus.py index 84f9979476..58100149fc 100644 --- a/neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_nexus.py +++ b/neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_nexus.py @@ -15,11 +15,11 @@ import collections import mock +from oslo.utils import importutils import testtools from neutron.common import constants as n_const from neutron.extensions import portbindings -from neutron.openstack.common import importutils from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2.drivers.cisco.nexus import constants from neutron.plugins.ml2.drivers.cisco.nexus import exceptions diff --git a/neutron/tests/unit/ml2/drivers/test_l2population.py b/neutron/tests/unit/ml2/drivers/test_l2population.py index 70aa4945a7..92f133e6a5 100644 --- a/neutron/tests/unit/ml2/drivers/test_l2population.py +++ b/neutron/tests/unit/ml2/drivers/test_l2population.py @@ -14,7 +14,9 @@ # under the License. import contextlib + import mock +from oslo.utils import timeutils from neutron.agent import l2population_rpc from neutron.common import constants @@ -24,7 +26,6 @@ from neutron.db import agents_db from neutron.extensions import portbindings from neutron.extensions import providernet as pnet from neutron import manager -from neutron.openstack.common import timeutils from neutron.plugins.ml2.drivers.l2pop import mech_driver as l2pop_mech_driver from neutron.plugins.ml2.drivers.l2pop import rpc as l2pop_rpc from neutron.plugins.ml2 import managers diff --git a/neutron/tests/unit/ofagent/ofa_test_base.py b/neutron/tests/unit/ofagent/ofa_test_base.py index 3578f21601..60c03ce762 100644 --- a/neutron/tests/unit/ofagent/ofa_test_base.py +++ b/neutron/tests/unit/ofagent/ofa_test_base.py @@ -17,8 +17,8 @@ import mock from oslo.config import cfg +from oslo.utils import importutils -from neutron.openstack.common import importutils from neutron.tests import base from neutron.tests.unit.ofagent import fake_oflib diff --git a/neutron/tests/unit/ofagent/test_arp_lib.py b/neutron/tests/unit/ofagent/test_arp_lib.py index f0c1d69584..883abaff8b 100644 --- a/neutron/tests/unit/ofagent/test_arp_lib.py +++ b/neutron/tests/unit/ofagent/test_arp_lib.py @@ -19,8 +19,8 @@ import contextlib import copy import mock +from oslo.utils import importutils -from neutron.openstack.common import importutils import neutron.plugins.ofagent.agent.metadata as meta from neutron.tests.unit.ofagent import ofa_test_base diff --git a/neutron/tests/unit/ofagent/test_ofa_flows.py b/neutron/tests/unit/ofagent/test_ofa_flows.py index a733288039..5c8b4c6926 100644 --- a/neutron/tests/unit/ofagent/test_ofa_flows.py +++ b/neutron/tests/unit/ofagent/test_ofa_flows.py @@ -16,8 +16,8 @@ import mock +from oslo.utils import importutils -from neutron.openstack.common import importutils import neutron.plugins.ofagent.agent.metadata as meta from neutron.tests.unit.ofagent import ofa_test_base diff --git a/neutron/tests/unit/ofagent/test_ofa_neutron_agent.py b/neutron/tests/unit/ofagent/test_ofa_neutron_agent.py index 55c105168b..f3f431bceb 100644 --- a/neutron/tests/unit/ofagent/test_ofa_neutron_agent.py +++ b/neutron/tests/unit/ofagent/test_ofa_neutron_agent.py @@ -26,10 +26,10 @@ import copy import mock import netaddr from oslo.config import cfg +from oslo.utils import importutils import testtools from neutron.common import constants as n_const -from neutron.openstack.common import importutils from neutron.plugins.common import constants as p_const from neutron.plugins.ml2.drivers.l2pop import rpc as l2pop_rpc from neutron.tests.unit.ofagent import ofa_test_base diff --git a/neutron/tests/unit/ofagent/test_ofswitch.py b/neutron/tests/unit/ofagent/test_ofswitch.py index bf35e2ed60..ecf4a66184 100644 --- a/neutron/tests/unit/ofagent/test_ofswitch.py +++ b/neutron/tests/unit/ofagent/test_ofswitch.py @@ -16,8 +16,8 @@ import mock +from oslo.utils import importutils -from neutron.openstack.common import importutils from neutron.tests.unit.ofagent import ofa_test_base diff --git a/neutron/tests/unit/openvswitch/test_agent_scheduler.py b/neutron/tests/unit/openvswitch/test_agent_scheduler.py index ccd046864f..29dcab553f 100644 --- a/neutron/tests/unit/openvswitch/test_agent_scheduler.py +++ b/neutron/tests/unit/openvswitch/test_agent_scheduler.py @@ -21,6 +21,7 @@ import mock from oslo.config import cfg from oslo.db import exception as db_exc from oslo import messaging +from oslo.utils import timeutils from webob import exc from neutron.api import extensions @@ -36,7 +37,6 @@ from neutron.extensions import agent from neutron.extensions import dhcpagentscheduler from neutron.extensions import l3agentscheduler from neutron import manager -from neutron.openstack.common import timeutils from neutron.openstack.common import uuidutils from neutron.plugins.common import constants as service_constants from neutron.tests import fake_notifier diff --git a/neutron/tests/unit/plumgrid/extensions/test_securitygroups.py b/neutron/tests/unit/plumgrid/extensions/test_securitygroups.py index 482c1b06bb..a98bd773d7 100644 --- a/neutron/tests/unit/plumgrid/extensions/test_securitygroups.py +++ b/neutron/tests/unit/plumgrid/extensions/test_securitygroups.py @@ -18,8 +18,8 @@ PLUMgrid plugin security group extension unit tests """ import mock +from oslo.utils import importutils -from neutron.openstack.common import importutils from neutron.plugins.plumgrid.plumgrid_plugin import plumgrid_plugin from neutron.tests.unit import test_extension_security_group as ext_sg diff --git a/neutron/tests/unit/plumgrid/test_plumgrid_plugin.py b/neutron/tests/unit/plumgrid/test_plumgrid_plugin.py index b40883976c..4e04b95b83 100644 --- a/neutron/tests/unit/plumgrid/test_plumgrid_plugin.py +++ b/neutron/tests/unit/plumgrid/test_plumgrid_plugin.py @@ -17,11 +17,11 @@ Test cases for Neutron PLUMgrid Plug-in """ import mock +from oslo.utils import importutils from neutron.extensions import portbindings from neutron.extensions import providernet as provider from neutron import manager -from neutron.openstack.common import importutils from neutron.plugins.plumgrid.plumgrid_plugin import plumgrid_plugin from neutron.tests.unit import _test_extension_portbindings as test_bindings from neutron.tests.unit import test_db_plugin as test_plugin diff --git a/neutron/tests/unit/services/firewall/agents/l3reference/test_firewall_l3_agent.py b/neutron/tests/unit/services/firewall/agents/l3reference/test_firewall_l3_agent.py index c675bce7c7..22b4169ed2 100644 --- a/neutron/tests/unit/services/firewall/agents/l3reference/test_firewall_l3_agent.py +++ b/neutron/tests/unit/services/firewall/agents/l3reference/test_firewall_l3_agent.py @@ -66,7 +66,7 @@ class TestFwaasL3AgentRpcCallback(base.BaseTestCase): def test_fw_config_match(self): test_agent_class = _setup_test_agent_class([constants.FIREWALL]) cfg.CONF.set_override('enabled', True, 'fwaas') - with mock.patch('neutron.openstack.common.importutils.import_object'): + with mock.patch('oslo.utils.importutils.import_object'): test_agent_class(cfg.CONF) def test_fw_config_mismatch_plugin_enabled_agent_disabled(self): @@ -77,7 +77,7 @@ class TestFwaasL3AgentRpcCallback(base.BaseTestCase): def test_fw_plugin_list_unavailable(self): test_agent_class = _setup_test_agent_class(None) cfg.CONF.set_override('enabled', False, 'fwaas') - with mock.patch('neutron.openstack.common.importutils.import_object'): + with mock.patch('oslo.utils.importutils.import_object'): test_agent_class(cfg.CONF) def test_create_firewall(self): diff --git a/neutron/tests/unit/services/l3_router/test_l3_apic_plugin.py b/neutron/tests/unit/services/l3_router/test_l3_apic_plugin.py index b2ead4e693..89e1f6cf1f 100644 --- a/neutron/tests/unit/services/l3_router/test_l3_apic_plugin.py +++ b/neutron/tests/unit/services/l3_router/test_l3_apic_plugin.py @@ -105,8 +105,7 @@ class TestCiscoApicL3Plugin(testlib_api.SqlTestCase, 'add_router_interface').start() mock.patch('neutron.db.l3_dvr_db.L3_NAT_with_dvr_db_mixin.' 'remove_router_interface').start() - mock.patch('neutron.openstack.common.excutils.' - 'save_and_reraise_exception').start() + mock.patch('oslo.utils.excutils.save_and_reraise_exception').start() def _test_add_router_interface(self, interface_info): mgr = self.plugin.manager diff --git a/neutron/tests/unit/services/metering/test_metering_plugin.py b/neutron/tests/unit/services/metering/test_metering_plugin.py index c2eaad5af2..d41ec17518 100644 --- a/neutron/tests/unit/services/metering/test_metering_plugin.py +++ b/neutron/tests/unit/services/metering/test_metering_plugin.py @@ -13,6 +13,7 @@ # under the License. import mock +from oslo.utils import timeutils from neutron.api.v2 import attributes as attr from neutron.common import constants as n_constants @@ -24,7 +25,6 @@ from neutron.db.metering import metering_rpc from neutron.extensions import l3 as ext_l3 from neutron.extensions import metering as ext_metering from neutron import manager -from neutron.openstack.common import timeutils from neutron.openstack.common import uuidutils from neutron.plugins.common import constants from neutron.tests.unit.db.metering import test_db_metering diff --git a/neutron/tests/unit/test_agent_ext_plugin.py b/neutron/tests/unit/test_agent_ext_plugin.py index 039af61818..e5f5557e09 100644 --- a/neutron/tests/unit/test_agent_ext_plugin.py +++ b/neutron/tests/unit/test_agent_ext_plugin.py @@ -17,6 +17,7 @@ import copy import time from oslo.config import cfg +from oslo.utils import timeutils from webob import exc from neutron.api.v2 import attributes @@ -27,7 +28,6 @@ from neutron.db import agents_db from neutron.db import db_base_plugin_v2 from neutron.extensions import agent from neutron.openstack.common import log as logging -from neutron.openstack.common import timeutils from neutron.openstack.common import uuidutils from neutron.tests.unit import test_api_v2 from neutron.tests.unit import test_db_plugin diff --git a/neutron/tests/unit/test_agent_netns_cleanup.py b/neutron/tests/unit/test_agent_netns_cleanup.py index ff2d62e01a..ef10b8ab5b 100644 --- a/neutron/tests/unit/test_agent_netns_cleanup.py +++ b/neutron/tests/unit/test_agent_netns_cleanup.py @@ -36,7 +36,7 @@ class TestNetnsCleanup(base.BaseTestCase): conf.AGENT.root_helper = 'sudo', conf.dhcp_driver = 'driver' - method_to_patch = 'neutron.openstack.common.importutils.import_object' + method_to_patch = 'oslo.utils.importutils.import_object' with mock.patch(method_to_patch) as import_object: driver = mock.Mock() diff --git a/neutron/tests/unit/test_db_plugin.py b/neutron/tests/unit/test_db_plugin.py index b5051b38e2..f1f54c3a14 100644 --- a/neutron/tests/unit/test_db_plugin.py +++ b/neutron/tests/unit/test_db_plugin.py @@ -19,6 +19,7 @@ import itertools import mock from oslo.config import cfg +from oslo.utils import importutils from testtools import matchers import webob.exc @@ -36,7 +37,6 @@ from neutron import context from neutron.db import db_base_plugin_v2 from neutron.db import models_v2 from neutron import manager -from neutron.openstack.common import importutils from neutron.tests import base from neutron.tests.unit import test_extensions from neutron.tests.unit import testlib_api diff --git a/neutron/tests/unit/test_dhcp_scheduler.py b/neutron/tests/unit/test_dhcp_scheduler.py index 293255eb9e..cf4f130bf1 100644 --- a/neutron/tests/unit/test_dhcp_scheduler.py +++ b/neutron/tests/unit/test_dhcp_scheduler.py @@ -15,13 +15,14 @@ import mock +from oslo.utils import timeutils + from neutron.common import constants from neutron.common import topics from neutron import context from neutron.db import agents_db from neutron.db import agentschedulers_db from neutron.db import models_v2 -from neutron.openstack.common import timeutils from neutron.scheduler import dhcp_agent_scheduler from neutron.tests.unit import testlib_api diff --git a/neutron/tests/unit/test_l3_plugin.py b/neutron/tests/unit/test_l3_plugin.py index 98daad2086..daf5052c45 100644 --- a/neutron/tests/unit/test_l3_plugin.py +++ b/neutron/tests/unit/test_l3_plugin.py @@ -20,6 +20,7 @@ import copy import mock import netaddr from oslo.config import cfg +from oslo.utils import importutils from webob import exc from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api @@ -39,7 +40,6 @@ from neutron.extensions import external_net from neutron.extensions import l3 from neutron.extensions import portbindings from neutron import manager -from neutron.openstack.common import importutils from neutron.openstack.common import log as logging from neutron.openstack.common import uuidutils from neutron.plugins.common import constants as service_constants diff --git a/neutron/tests/unit/test_l3_schedulers.py b/neutron/tests/unit/test_l3_schedulers.py index e9af85d499..c6c1a10da1 100644 --- a/neutron/tests/unit/test_l3_schedulers.py +++ b/neutron/tests/unit/test_l3_schedulers.py @@ -19,6 +19,8 @@ import uuid import mock from oslo.config import cfg +from oslo.utils import importutils +from oslo.utils import timeutils from sqlalchemy.orm import query from neutron.common import constants @@ -33,8 +35,6 @@ from neutron.db import l3_dvrscheduler_db from neutron.db import l3_hamode_db from neutron.db import l3_hascheduler_db from neutron import manager -from neutron.openstack.common import importutils -from neutron.openstack.common import timeutils from neutron.scheduler import l3_agent_scheduler from neutron.tests import base from neutron.tests.unit import test_db_plugin diff --git a/neutron/tests/unit/test_metadata_agent.py b/neutron/tests/unit/test_metadata_agent.py index 8734d370f5..ea87913da6 100644 --- a/neutron/tests/unit/test_metadata_agent.py +++ b/neutron/tests/unit/test_metadata_agent.py @@ -168,7 +168,7 @@ class TestMetadataProxyHandlerCache(TestMetadataProxyHandlerBase): 'not_used': [1, 2, 3]} expected_networks = ('network_id1',) with mock.patch( - 'neutron.openstack.common.timeutils.utcnow_ts', return_value=0): + 'oslo.utils.timeutils.utcnow_ts', return_value=0): mock_list_ports = self.qclient.return_value.list_ports mock_list_ports.return_value = ports networks = self.handler._get_router_networks(router_id) diff --git a/neutron/tests/unit/test_policy.py b/neutron/tests/unit/test_policy.py index 16cbc29fda..73cde09498 100644 --- a/neutron/tests/unit/test_policy.py +++ b/neutron/tests/unit/test_policy.py @@ -23,6 +23,7 @@ import fixtures import mock from oslo.config import cfg from oslo.serialization import jsonutils +from oslo.utils import importutils import six import six.moves.urllib.request as urlrequest @@ -32,7 +33,6 @@ from neutron.common import constants as const from neutron.common import exceptions from neutron import context from neutron import manager -from neutron.openstack.common import importutils from neutron.openstack.common import policy as common_policy from neutron import policy from neutron.tests import base diff --git a/neutron/wsgi.py b/neutron/wsgi.py index 101c0dc0de..ef189a89a3 100644 --- a/neutron/wsgi.py +++ b/neutron/wsgi.py @@ -29,6 +29,7 @@ import eventlet.wsgi eventlet.patcher.monkey_patch(all=False, socket=True, thread=True) from oslo.config import cfg from oslo.serialization import jsonutils +from oslo.utils import excutils import routes.middleware import webob.dec import webob.exc @@ -36,7 +37,6 @@ import webob.exc from neutron.common import exceptions as exception from neutron import context from neutron.db import api -from neutron.openstack.common import excutils from neutron.openstack.common import gettextutils from neutron.openstack.common import log as logging from neutron.openstack.common import service as common_service diff --git a/openstack-common.conf b/openstack-common.conf index 2eb0022ffe..250aac48ad 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -3,11 +3,9 @@ module=cache module=context module=eventlet_backdoor -module=excutils module=fileutils module=fixture module=gettextutils -module=importutils module=install_venv_common module=local module=lockutils @@ -19,15 +17,12 @@ module=middleware.correlation_id module=middleware.debug module=middleware.request_id module=middleware.sizelimit -module=network_utils module=periodic_task module=policy module=processutils module=service -module=strutils module=systemd module=threadgroup -module=timeutils module=uuidutils # The base module to hold the copy of openstack.common