diff --git a/bin/manila-all b/bin/manila-all index e48c7e1f..94c86031 100755 --- a/bin/manila-all +++ b/bin/manila-all @@ -32,7 +32,7 @@ eventlet.monkey_patch() import os import sys -from oslo.config import cfg +from oslo_config import cfg possible_topdir = os.path.normpath(os.path.join (os.path.abspath(sys.argv[0]), os.pardir, os.pardir)) diff --git a/bin/manila-api b/bin/manila-api index 3b2ef86f..52f0e731 100755 --- a/bin/manila-api +++ b/bin/manila-api @@ -28,7 +28,7 @@ eventlet.monkey_patch() import os import sys -from oslo.config import cfg +from oslo_config import cfg possible_topdir = os.path.normpath(os.path.join (os.path.abspath(sys.argv[0]), diff --git a/bin/manila-manage b/bin/manila-manage index 2a613828..4f0645c9 100755 --- a/bin/manila-manage +++ b/bin/manila-manage @@ -70,8 +70,8 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'manila', '__init__.py')): from manila import i18n i18n.enable_lazy() -from oslo.config import cfg -from oslo.utils import uuidutils +from oslo_config import cfg +from oslo_utils import uuidutils from manila.common import config # Need to register global_opts # noqa from manila import context diff --git a/bin/manila-scheduler b/bin/manila-scheduler index 13f443a0..25b30a72 100755 --- a/bin/manila-scheduler +++ b/bin/manila-scheduler @@ -24,7 +24,7 @@ eventlet.monkey_patch() import os import sys -from oslo.config import cfg +from oslo_config import cfg # If ../manila/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... diff --git a/bin/manila-share b/bin/manila-share index 8ea785e3..87fab581 100755 --- a/bin/manila-share +++ b/bin/manila-share @@ -23,7 +23,7 @@ eventlet.monkey_patch() import os import sys -from oslo.config import cfg +from oslo_config import cfg # If ../manila/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... diff --git a/contrib/tempest/tempest/config_share.py b/contrib/tempest/tempest/config_share.py index 28ccba56..0832bf59 100644 --- a/contrib/tempest/tempest/config_share.py +++ b/contrib/tempest/tempest/config_share.py @@ -15,7 +15,7 @@ from __future__ import print_function -from oslo.config import cfg +from oslo_config import cfg from tempest import config # noqa diff --git a/manila/api/__init__.py b/manila/api/__init__.py index ef35fc4a..1781b58d 100644 --- a/manila/api/__init__.py +++ b/manila/api/__init__.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.config import cfg +from oslo_config import cfg import paste.urlmap diff --git a/manila/api/common.py b/manila/api/common.py index aeda94bc..cf4243dc 100644 --- a/manila/api/common.py +++ b/manila/api/common.py @@ -16,7 +16,7 @@ import os import re -from oslo.config import cfg +from oslo_config import cfg import six from six.moves.urllib import parse import webob diff --git a/manila/api/contrib/__init__.py b/manila/api/contrib/__init__.py index c76eb7f4..7207d41e 100644 --- a/manila/api/contrib/__init__.py +++ b/manila/api/contrib/__init__.py @@ -19,7 +19,7 @@ It can't be called 'extensions' because that causes namespacing problems. """ -from oslo.config import cfg +from oslo_config import cfg from manila.api import extensions from manila.openstack.common import log as logging diff --git a/manila/api/contrib/quotas.py b/manila/api/contrib/quotas.py index 419b5d0a..47ab397c 100644 --- a/manila/api/contrib/quotas.py +++ b/manila/api/contrib/quotas.py @@ -14,7 +14,7 @@ # under the License. -from oslo.utils import strutils +from oslo_utils import strutils from six.moves.urllib import parse import webob diff --git a/manila/api/extensions.py b/manila/api/extensions.py index 131f299f..b6d2e739 100644 --- a/manila/api/extensions.py +++ b/manila/api/extensions.py @@ -16,8 +16,8 @@ import os -from oslo.config import cfg -from oslo.utils import importutils +from oslo_config import cfg +from oslo_utils import importutils import six import webob.dec import webob.exc diff --git a/manila/api/middleware/auth.py b/manila/api/middleware/auth.py index 3e2bc543..38e72b81 100644 --- a/manila/api/middleware/auth.py +++ b/manila/api/middleware/auth.py @@ -18,8 +18,8 @@ Common Auth Middleware. """ import os -from oslo.config import cfg -from oslo.serialization import jsonutils +from oslo_config import cfg +from oslo_serialization import jsonutils import webob.dec import webob.exc diff --git a/manila/api/middleware/sizelimit.py b/manila/api/middleware/sizelimit.py index 8e7401d9..19bd2ffb 100644 --- a/manila/api/middleware/sizelimit.py +++ b/manila/api/middleware/sizelimit.py @@ -16,7 +16,7 @@ Request Body limiting middleware. """ -from oslo.config import cfg +from oslo_config import cfg import webob.dec import webob.exc diff --git a/manila/api/openstack/wsgi.py b/manila/api/openstack/wsgi.py index 742df1cf..d36a09fd 100644 --- a/manila/api/openstack/wsgi.py +++ b/manila/api/openstack/wsgi.py @@ -15,7 +15,7 @@ import inspect import math -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six import time import webob diff --git a/manila/api/v1/limits.py b/manila/api/v1/limits.py index 75c89b46..6c3c59f9 100644 --- a/manila/api/v1/limits.py +++ b/manila/api/v1/limits.py @@ -24,8 +24,8 @@ import math import re import time -from oslo.serialization import jsonutils -from oslo.utils import importutils +from oslo_serialization import jsonutils +from oslo_utils import importutils import webob.dec import webob.exc diff --git a/manila/api/v1/share_networks.py b/manila/api/v1/share_networks.py index 30b368c4..9e259980 100644 --- a/manila/api/v1/share_networks.py +++ b/manila/api/v1/share_networks.py @@ -15,8 +15,8 @@ """The shares api.""" -from oslo.db import exception as db_exception -from oslo.utils import timeutils +from oslo_db import exception as db_exception +from oslo_utils import timeutils import six import webob from webob import exc diff --git a/manila/api/v1/shares.py b/manila/api/v1/shares.py index 37b9b36e..e4fab17b 100644 --- a/manila/api/v1/shares.py +++ b/manila/api/v1/shares.py @@ -17,7 +17,7 @@ import ast -from oslo.utils import uuidutils +from oslo_utils import uuidutils import six import webob from webob import exc diff --git a/manila/api/versions.py b/manila/api/versions.py index bb010e8f..5d874404 100644 --- a/manila/api/versions.py +++ b/manila/api/versions.py @@ -16,7 +16,7 @@ import datetime from lxml import etree -from oslo.config import cfg +from oslo_config import cfg from manila.api.openstack import wsgi from manila.api.views import versions as views_versions diff --git a/manila/api/views/limits.py b/manila/api/views/limits.py index a0e80e18..591dc450 100644 --- a/manila/api/views/limits.py +++ b/manila/api/views/limits.py @@ -15,7 +15,7 @@ import datetime -from oslo.utils import timeutils +from oslo_utils import timeutils import six diff --git a/manila/common/config.py b/manila/common/config.py index 9f575a37..ca3ff03b 100644 --- a/manila/common/config.py +++ b/manila/common/config.py @@ -26,7 +26,7 @@ stepping stone. import socket -from oslo.config import cfg +from oslo_config import cfg from manila.i18n import _ diff --git a/manila/compute/__init__.py b/manila/compute/__init__.py index fa569dc9..2cddd10f 100644 --- a/manila/compute/__init__.py +++ b/manila/compute/__init__.py @@ -13,22 +13,22 @@ # License for the specific language governing permissions and limitations # under the License. -import oslo.config.cfg -import oslo.utils.importutils +import oslo_config.cfg +import oslo_utils.importutils _compute_opts = [ - oslo.config.cfg.StrOpt('compute_api_class', + oslo_config.cfg.StrOpt('compute_api_class', default='manila.compute.nova.API', help='The full class name of the ' 'Compute API class to use.'), ] -oslo.config.cfg.CONF.register_opts(_compute_opts) +oslo_config.cfg.CONF.register_opts(_compute_opts) def API(): - importutils = oslo.utils.importutils - compute_api_class = oslo.config.cfg.CONF.compute_api_class + importutils = oslo_utils.importutils + compute_api_class = oslo_config.cfg.CONF.compute_api_class cls = importutils.import_class(compute_api_class) return cls() diff --git a/manila/compute/nova.py b/manila/compute/nova.py index 199f5444..3963ffb6 100644 --- a/manila/compute/nova.py +++ b/manila/compute/nova.py @@ -23,7 +23,7 @@ from novaclient import service_catalog from novaclient.v1_1 import client as nova_client from novaclient.v1_1.contrib import assisted_volume_snapshots from novaclient.v1_1 import servers as nova_servers -from oslo.config import cfg +from oslo_config import cfg from manila.db import base from manila import exception diff --git a/manila/context.py b/manila/context.py index 37dcc535..91cee38b 100644 --- a/manila/context.py +++ b/manila/context.py @@ -19,8 +19,8 @@ import copy -from oslo.utils import timeutils from oslo_context import context as common_context +from oslo_utils import timeutils import six from manila.i18n import _ diff --git a/manila/db/api.py b/manila/db/api.py index 9873cb12..e5459a79 100644 --- a/manila/db/api.py +++ b/manila/db/api.py @@ -40,8 +40,8 @@ these objects be simple dictionaries. pool of available hardware (Default: True) """ -from oslo.config import cfg -from oslo.db import api as db_api +from oslo_config import cfg +from oslo_db import api as db_api db_opts = [ diff --git a/manila/db/base.py b/manila/db/base.py index 72ab8d78..d11bcfe6 100644 --- a/manila/db/base.py +++ b/manila/db/base.py @@ -16,8 +16,8 @@ """Base class for classes that need modular database access.""" -from oslo.config import cfg -from oslo.utils import importutils +from oslo_config import cfg +from oslo_utils import importutils db_driver_opt = cfg.StrOpt('db_driver', default='manila.db', diff --git a/manila/db/migrations/alembic/migration.py b/manila/db/migrations/alembic/migration.py index c1699742..33dd265e 100644 --- a/manila/db/migrations/alembic/migration.py +++ b/manila/db/migrations/alembic/migration.py @@ -17,7 +17,7 @@ import os import alembic from alembic import config as alembic_config import alembic.migration as alembic_migration -from oslo.config import cfg +from oslo_config import cfg from manila.db.sqlalchemy import api as db_api diff --git a/manila/db/sqlalchemy/api.py b/manila/db/sqlalchemy/api.py index f6f51db3..88096dd5 100644 --- a/manila/db/sqlalchemy/api.py +++ b/manila/db/sqlalchemy/api.py @@ -22,11 +22,11 @@ import sys import uuid import warnings -from oslo.config import cfg -from oslo.db import exception as db_exception -from oslo.db import options as db_options -from oslo.db.sqlalchemy import session -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_db import exception as db_exception +from oslo_db import options as db_options +from oslo_db.sqlalchemy import session +from oslo_utils import timeutils import six from sqlalchemy import or_ from sqlalchemy.orm import joinedload diff --git a/manila/db/sqlalchemy/models.py b/manila/db/sqlalchemy/models.py index 5f5485b8..9f02c999 100644 --- a/manila/db/sqlalchemy/models.py +++ b/manila/db/sqlalchemy/models.py @@ -19,9 +19,9 @@ SQLAlchemy models for Manila data. """ -from oslo.config import cfg -from oslo.db.sqlalchemy import models -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_db.sqlalchemy import models +from oslo_utils import timeutils import six from sqlalchemy import Column, Integer, String from sqlalchemy.ext.declarative import declarative_base diff --git a/manila/exception.py b/manila/exception.py index 0a3b1748..936541b4 100644 --- a/manila/exception.py +++ b/manila/exception.py @@ -22,8 +22,8 @@ SHOULD include dedicated exception logging. """ -from oslo.config import cfg from oslo_concurrency import processutils +from oslo_config import cfg import six import webob.exc diff --git a/manila/hacking/checks.py b/manila/hacking/checks.py index 77588150..1281f10c 100644 --- a/manila/hacking/checks.py +++ b/manila/hacking/checks.py @@ -52,6 +52,9 @@ string_translation = re.compile(r"[^_]*_\(\s*('|\")") underscore_import_check = re.compile(r"(.)*import _(.)*") # We need this for cases where they have created their own _ function. custom_underscore_check = re.compile(r"(.)*_\s*=\s*(.)*") +# TODO(toabctl): Remove the oslo.messaging exception when package +# moved away from namespace +oslo_namespace_imports = re.compile(r"from[\s]*oslo[.](?!messaging)(.*)") class BaseASTChecker(ast.NodeVisitor): @@ -221,9 +224,20 @@ class CheckForTransAdd(BaseASTChecker): super(CheckForTransAdd, self).generic_visit(node) +def check_oslo_namespace_imports(logical_line, physical_line, filename): + if pep8.noqa(physical_line): + return + if re.match(oslo_namespace_imports, logical_line): + msg = ("N333: '%s' must be used instead of '%s'.") % ( + logical_line.replace('oslo.', 'oslo_'), + logical_line) + yield(0, msg) + + def factory(register): register(validate_log_translations) register(check_explicit_underscore_import) register(no_translate_debug_logs) register(CheckForStrExc) register(CheckForTransAdd) + register(check_oslo_namespace_imports) diff --git a/manila/i18n.py b/manila/i18n.py index 21c7eb8c..6c4169ec 100644 --- a/manila/i18n.py +++ b/manila/i18n.py @@ -18,11 +18,11 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html . """ -from oslo import i18n +import oslo_i18n DOMAIN = 'manila' -_translators = i18n.TranslatorFactory(domain=DOMAIN) +_translators = oslo_i18n.TranslatorFactory(domain=DOMAIN) # The primary translation function using the well-known name "_" _ = _translators.primary @@ -39,12 +39,12 @@ _LC = _translators.log_critical def enable_lazy(): - return i18n.enable_lazy() + return oslo_i18n.enable_lazy() def translate(value, user_locale): - return i18n.translate(value, user_locale) + return oslo_i18n.translate(value, user_locale) def get_available_languages(): - return i18n.get_available_languages(DOMAIN) + return oslo_i18n.get_available_languages(DOMAIN) diff --git a/manila/manager.py b/manila/manager.py index 10a1d5cd..c196305d 100644 --- a/manila/manager.py +++ b/manila/manager.py @@ -51,7 +51,7 @@ This module provides Manager, a base class for managers. """ -from oslo.config import cfg +from oslo_config import cfg import six from manila.db import base diff --git a/manila/network/__init__.py b/manila/network/__init__.py index ce228c09..88f56694 100644 --- a/manila/network/__init__.py +++ b/manila/network/__init__.py @@ -15,8 +15,8 @@ # under the License. import abc -from oslo.config import cfg -from oslo.utils import importutils +from oslo_config import cfg +from oslo_utils import importutils from manila.db import base as db_base diff --git a/manila/network/linux/interface.py b/manila/network/linux/interface.py index ae393162..e14a1c2b 100644 --- a/manila/network/linux/interface.py +++ b/manila/network/linux/interface.py @@ -16,7 +16,7 @@ import abc import netaddr -from oslo.config import cfg +from oslo_config import cfg import six from manila import exception diff --git a/manila/network/neutron/api.py b/manila/network/neutron/api.py index f4944d86..c6bb983d 100644 --- a/manila/network/neutron/api.py +++ b/manila/network/neutron/api.py @@ -16,7 +16,7 @@ from neutronclient.common import exceptions as neutron_client_exc from neutronclient.v2_0 import client as clientv20 -from oslo.config import cfg +from oslo_config import cfg from manila import context from manila.db import base diff --git a/manila/quota.py b/manila/quota.py index 565f0f41..98d01355 100644 --- a/manila/quota.py +++ b/manila/quota.py @@ -18,9 +18,9 @@ import datetime -from oslo.config import cfg -from oslo.utils import importutils -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_utils import importutils +from oslo_utils import timeutils import six from manila import db diff --git a/manila/rpc.py b/manila/rpc.py index 024c6525..3d61489f 100644 --- a/manila/rpc.py +++ b/manila/rpc.py @@ -26,9 +26,9 @@ __all__ = [ 'TRANSPORT_ALIASES', ] -from oslo.config import cfg from oslo import messaging -from oslo.serialization import jsonutils +from oslo_config import cfg +from oslo_serialization import jsonutils import manila.context import manila.exception diff --git a/manila/scheduler/chance.py b/manila/scheduler/chance.py index 56af334e..5df2cad0 100644 --- a/manila/scheduler/chance.py +++ b/manila/scheduler/chance.py @@ -21,7 +21,7 @@ Chance (Random) Scheduler implementation import random -from oslo.config import cfg +from oslo_config import cfg from manila import exception from manila.i18n import _ diff --git a/manila/scheduler/driver.py b/manila/scheduler/driver.py index ca6f4670..bef19173 100644 --- a/manila/scheduler/driver.py +++ b/manila/scheduler/driver.py @@ -19,9 +19,9 @@ Scheduler base class that all Schedulers should inherit from """ -from oslo.config import cfg -from oslo.utils import importutils -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_utils import importutils +from oslo_utils import timeutils from manila import db from manila.i18n import _ diff --git a/manila/scheduler/filter_scheduler.py b/manila/scheduler/filter_scheduler.py index 4e42a43e..7632c6b4 100644 --- a/manila/scheduler/filter_scheduler.py +++ b/manila/scheduler/filter_scheduler.py @@ -20,7 +20,7 @@ You can customize this scheduler by specifying your own share Filters and Weighing Functions. """ -from oslo.config import cfg +from oslo_config import cfg from manila import exception from manila.i18n import _ diff --git a/manila/scheduler/host_manager.py b/manila/scheduler/host_manager.py index 1526274c..c6e3faa1 100644 --- a/manila/scheduler/host_manager.py +++ b/manila/scheduler/host_manager.py @@ -19,8 +19,8 @@ Manage hosts in the current zone. import UserDict -from oslo.config import cfg -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_utils import timeutils import six from manila import db diff --git a/manila/scheduler/manager.py b/manila/scheduler/manager.py index 9344e4c4..068479f0 100644 --- a/manila/scheduler/manager.py +++ b/manila/scheduler/manager.py @@ -19,9 +19,9 @@ Scheduler Service """ -from oslo.config import cfg -from oslo.utils import excutils -from oslo.utils import importutils +from oslo_config import cfg +from oslo_utils import excutils +from oslo_utils import importutils from manila import context from manila import db diff --git a/manila/scheduler/rpcapi.py b/manila/scheduler/rpcapi.py index 7cec2d18..17793c65 100644 --- a/manila/scheduler/rpcapi.py +++ b/manila/scheduler/rpcapi.py @@ -16,9 +16,9 @@ Client side of the scheduler manager RPC API. """ -from oslo.config import cfg from oslo import messaging -from oslo.serialization import jsonutils +from oslo_config import cfg +from oslo_serialization import jsonutils from manila import rpc diff --git a/manila/scheduler/scheduler_options.py b/manila/scheduler/scheduler_options.py index 227e165f..37862a95 100644 --- a/manila/scheduler/scheduler_options.py +++ b/manila/scheduler/scheduler_options.py @@ -23,9 +23,9 @@ dynamic configuration. import datetime import os -from oslo.config import cfg -from oslo.serialization import jsonutils -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_serialization import jsonutils +from oslo_utils import timeutils from manila.i18n import _LE from manila.openstack.common import log as logging diff --git a/manila/scheduler/simple.py b/manila/scheduler/simple.py index 3f363422..b41e87f6 100644 --- a/manila/scheduler/simple.py +++ b/manila/scheduler/simple.py @@ -19,7 +19,7 @@ Simple Scheduler """ -from oslo.config import cfg +from oslo_config import cfg from manila import db from manila import exception diff --git a/manila/scheduler/weights/capacity.py b/manila/scheduler/weights/capacity.py index b30cff4d..348bcdf8 100644 --- a/manila/scheduler/weights/capacity.py +++ b/manila/scheduler/weights/capacity.py @@ -22,7 +22,7 @@ number and the weighing has the opposite effect of the default. import math -from oslo.config import cfg +from oslo_config import cfg from manila.openstack.common.scheduler import weights diff --git a/manila/service.py b/manila/service.py index 7adc9516..34cedae6 100644 --- a/manila/service.py +++ b/manila/service.py @@ -27,9 +27,9 @@ import time import eventlet import greenlet -from oslo.config import cfg from oslo import messaging -from oslo.utils import importutils +from oslo_config import cfg +from oslo_utils import importutils from manila import context from manila import db diff --git a/manila/share/__init__.py b/manila/share/__init__.py index 7d6bfad1..986c1c7c 100644 --- a/manila/share/__init__.py +++ b/manila/share/__init__.py @@ -16,7 +16,7 @@ # Importing full names to not pollute the namespace and cause possible # collisions with use of 'from manila.share import ' elsewhere. -import oslo.utils.importutils as import_utils +import oslo_utils.importutils as import_utils from manila.common import config diff --git a/manila/share/api.py b/manila/share/api.py index c205d18a..377a0c76 100644 --- a/manila/share/api.py +++ b/manila/share/api.py @@ -18,9 +18,9 @@ Handles all requests relating to shares. """ -from oslo.config import cfg -from oslo.utils import excutils -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_utils import excutils +from oslo_utils import timeutils import six from manila.api import extensions diff --git a/manila/share/configuration.py b/manila/share/configuration.py index d3550b8c..17705766 100644 --- a/manila/share/configuration.py +++ b/manila/share/configuration.py @@ -42,7 +42,7 @@ option group. This is due to the way cfg works. All cfg options must be defined and registered in the group in which they are used. """ -from oslo.config import cfg +from oslo_config import cfg from manila.openstack.common import log as logging diff --git a/manila/share/driver.py b/manila/share/driver.py index 61eeaa1e..d8591f1c 100644 --- a/manila/share/driver.py +++ b/manila/share/driver.py @@ -20,7 +20,7 @@ Drivers for shares. import time -from oslo.config import cfg +from oslo_config import cfg from manila import exception from manila.i18n import _LE diff --git a/manila/share/drivers/emc/driver.py b/manila/share/drivers/emc/driver.py index 446a381f..38364f05 100644 --- a/manila/share/drivers/emc/driver.py +++ b/manila/share/drivers/emc/driver.py @@ -20,7 +20,7 @@ backend. Use the Manila configuration variable "share_backend_name" to specify, which backend plugins to use. """ -from oslo.config import cfg +from oslo_config import cfg from manila.openstack.common import log from manila.share import driver diff --git a/manila/share/drivers/emc/plugins/vnx/connection.py b/manila/share/drivers/emc/plugins/vnx/connection.py index d8191d13..c36c088e 100644 --- a/manila/share/drivers/emc/plugins/vnx/connection.py +++ b/manila/share/drivers/emc/plugins/vnx/connection.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. """VNX backend for the EMC Manila driver.""" -from oslo.utils import excutils -from oslo.utils import units +from oslo_utils import excutils +from oslo_utils import units import six from manila import db as manila_db diff --git a/manila/share/drivers/emc/plugins/vnx/utils.py b/manila/share/drivers/emc/plugins/vnx/utils.py index 59d5d3e8..b4a9dd12 100644 --- a/manila/share/drivers/emc/plugins/vnx/utils.py +++ b/manila/share/drivers/emc/plugins/vnx/utils.py @@ -14,8 +14,8 @@ # under the License. import types -from oslo.config import cfg -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_utils import timeutils from manila.openstack.common import log diff --git a/manila/share/drivers/ganesha/__init__.py b/manila/share/drivers/ganesha/__init__.py index ece44960..cfc1f8dc 100644 --- a/manila/share/drivers/ganesha/__init__.py +++ b/manila/share/drivers/ganesha/__init__.py @@ -18,7 +18,7 @@ import errno import os import re -from oslo.config import cfg +from oslo_config import cfg import six from manila import exception diff --git a/manila/share/drivers/ganesha/manager.py b/manila/share/drivers/ganesha/manager.py index b953fdc5..6cf44921 100644 --- a/manila/share/drivers/ganesha/manager.py +++ b/manila/share/drivers/ganesha/manager.py @@ -18,7 +18,7 @@ import pipes import re import sys -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six from manila import exception diff --git a/manila/share/drivers/generic.py b/manila/share/drivers/generic.py index b18ceef0..e99030de 100644 --- a/manila/share/drivers/generic.py +++ b/manila/share/drivers/generic.py @@ -19,10 +19,10 @@ import os import re import time -from oslo.config import cfg -from oslo.utils import excutils -from oslo.utils import importutils from oslo_concurrency import processutils +from oslo_config import cfg +from oslo_utils import excutils +from oslo_utils import importutils import six from manila.common import constants as const diff --git a/manila/share/drivers/glusterfs.py b/manila/share/drivers/glusterfs.py index 17512c2f..64bb93b4 100644 --- a/manila/share/drivers/glusterfs.py +++ b/manila/share/drivers/glusterfs.py @@ -29,7 +29,7 @@ import re import sys import xml.etree.cElementTree as etree -from oslo.config import cfg +from oslo_config import cfg import six from manila import exception diff --git a/manila/share/drivers/glusterfs_native.py b/manila/share/drivers/glusterfs_native.py index e2ef91c4..a0ee94cb 100644 --- a/manila/share/drivers/glusterfs_native.py +++ b/manila/share/drivers/glusterfs_native.py @@ -30,7 +30,7 @@ import pipes import shutil import tempfile -from oslo.config import cfg +from oslo_config import cfg import six from manila import exception diff --git a/manila/share/drivers/huawei/huawei_helper.py b/manila/share/drivers/huawei/huawei_helper.py index eba1ffbb..5360efe1 100644 --- a/manila/share/drivers/huawei/huawei_helper.py +++ b/manila/share/drivers/huawei/huawei_helper.py @@ -16,8 +16,8 @@ import base64 from xml import etree -from oslo.serialization import jsonutils -from oslo.utils import units +from oslo_serialization import jsonutils +from oslo_utils import units import six from six.moves import http_cookiejar from six.moves.urllib import request as urlreq # pylint: disable=E0611 diff --git a/manila/share/drivers/huawei/huawei_nas.py b/manila/share/drivers/huawei/huawei_nas.py index 6c9e673a..de447577 100644 --- a/manila/share/drivers/huawei/huawei_nas.py +++ b/manila/share/drivers/huawei/huawei_nas.py @@ -16,9 +16,9 @@ """Huawei Nas Driver for Huawei OceanStor V3 storage arrays.""" import time -from oslo.config import cfg -from oslo.utils import excutils -from oslo.utils import units +from oslo_config import cfg +from oslo_utils import excutils +from oslo_utils import units from manila import exception from manila.i18n import _, _LI, _LW diff --git a/manila/share/drivers/ibm/gpfs.py b/manila/share/drivers/ibm/gpfs.py index 67fd3f1b..2c6fada4 100644 --- a/manila/share/drivers/ibm/gpfs.py +++ b/manila/share/drivers/ibm/gpfs.py @@ -36,11 +36,11 @@ import pipes import re import socket -from oslo.config import cfg -from oslo.utils import excutils -from oslo.utils import importutils -from oslo.utils import units from oslo_concurrency import processutils +from oslo_config import cfg +from oslo_utils import excutils +from oslo_utils import importutils +from oslo_utils import units import six from manila import exception diff --git a/manila/share/drivers/netapp/cluster_mode.py b/manila/share/drivers/netapp/cluster_mode.py index a5e35b30..ab29e499 100644 --- a/manila/share/drivers/netapp/cluster_mode.py +++ b/manila/share/drivers/netapp/cluster_mode.py @@ -24,9 +24,9 @@ import copy import hashlib import re -from oslo.config import cfg -from oslo.utils import excutils -from oslo.utils import units +from oslo_config import cfg +from oslo_utils import excutils +from oslo_utils import units import six from manila import context diff --git a/manila/share/drivers/netapp/utils.py b/manila/share/drivers/netapp/utils.py index 34ce86a6..8394ab20 100644 --- a/manila/share/drivers/netapp/utils.py +++ b/manila/share/drivers/netapp/utils.py @@ -22,8 +22,8 @@ import copy import platform import socket -from oslo.concurrency import processutils as putils -from oslo.utils import timeutils +from oslo_concurrency import processutils as putils +from oslo_utils import timeutils from manila.i18n import _LI, _LW from manila.openstack.common import log as logging diff --git a/manila/share/drivers/service_instance.py b/manila/share/drivers/service_instance.py index a2647119..95011ca8 100644 --- a/manila/share/drivers/service_instance.py +++ b/manila/share/drivers/service_instance.py @@ -21,8 +21,8 @@ import threading import time import netaddr -from oslo.config import cfg -from oslo.utils import importutils +from oslo_config import cfg +from oslo_utils import importutils import six from manila.common import constants diff --git a/manila/share/drivers/zfssa/restclient.py b/manila/share/drivers/zfssa/restclient.py index d8d3747f..c850c9ce 100644 --- a/manila/share/drivers/zfssa/restclient.py +++ b/manila/share/drivers/zfssa/restclient.py @@ -21,7 +21,7 @@ TODO(diemtran): this module needs to be placed in a library common to OpenStack import httplib import time -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six # pylint: disable=E0611,F0401 from six.moves.urllib import error as urlerror diff --git a/manila/share/drivers/zfssa/zfssarest.py b/manila/share/drivers/zfssa/zfssarest.py index 868d0219..e97957fd 100644 --- a/manila/share/drivers/zfssa/zfssarest.py +++ b/manila/share/drivers/zfssa/zfssarest.py @@ -14,7 +14,7 @@ """ ZFS Storage Appliance Proxy """ -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from manila import exception from manila.i18n import _ diff --git a/manila/share/drivers/zfssa/zfssashare.py b/manila/share/drivers/zfssa/zfssashare.py index 22ceba93..3914a12e 100644 --- a/manila/share/drivers/zfssa/zfssashare.py +++ b/manila/share/drivers/zfssa/zfssashare.py @@ -17,8 +17,8 @@ ZFS Storage Appliance Manila Share Driver import base64 -from oslo.config import cfg -from oslo.utils import units +from oslo_config import cfg +from oslo_utils import units from manila import exception from manila.i18n import _ diff --git a/manila/share/manager.py b/manila/share/manager.py index a993dbc1..d5c30e3f 100644 --- a/manila/share/manager.py +++ b/manila/share/manager.py @@ -19,10 +19,10 @@ :share_driver: Used by :class:`ShareManager`. """ -from oslo.config import cfg -from oslo.utils import excutils -from oslo.utils import importutils -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_utils import excutils +from oslo_utils import importutils +from oslo_utils import timeutils import six from manila.common import constants diff --git a/manila/share/rpcapi.py b/manila/share/rpcapi.py index 4b5d47f3..a364e03f 100644 --- a/manila/share/rpcapi.py +++ b/manila/share/rpcapi.py @@ -16,9 +16,9 @@ Client side of the share RPC API. """ -from oslo.config import cfg from oslo import messaging -from oslo.serialization import jsonutils +from oslo_config import cfg +from oslo_serialization import jsonutils from manila import rpc diff --git a/manila/share/volume_types.py b/manila/share/volume_types.py index ef250e8f..7865c73d 100644 --- a/manila/share/volume_types.py +++ b/manila/share/volume_types.py @@ -15,8 +15,8 @@ """Built-in volume type properties.""" -from oslo.config import cfg -from oslo.db import exception as db_exception +from oslo_config import cfg +from oslo_db import exception as db_exception import six from manila import context diff --git a/manila/test.py b/manila/test.py index e52d127e..c00a939e 100644 --- a/manila/test.py +++ b/manila/test.py @@ -27,10 +27,10 @@ import uuid import fixtures import mock -from oslo.config import cfg -from oslo.config import fixture as config_fixture from oslo.messaging import conffixture as messaging_conffixture from oslo_concurrency import lockutils +from oslo_config import cfg +from oslo_config import fixture as config_fixture import oslotest.base as base_test import six diff --git a/manila/tests/api/contrib/test_admin_actions.py b/manila/tests/api/contrib/test_admin_actions.py index 37ea60a2..7952086f 100644 --- a/manila/tests/api/contrib/test_admin_actions.py +++ b/manila/tests/api/contrib/test_admin_actions.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.config import cfg -from oslo.serialization import jsonutils +from oslo_config import cfg +from oslo_serialization import jsonutils import webob from manila import context diff --git a/manila/tests/api/contrib/test_services.py b/manila/tests/api/contrib/test_services.py index b56bccb3..c62dd495 100644 --- a/manila/tests/api/contrib/test_services.py +++ b/manila/tests/api/contrib/test_services.py @@ -17,7 +17,7 @@ import datetime -from oslo.utils import timeutils +from oslo_utils import timeutils from manila.api.contrib import services from manila import context diff --git a/manila/tests/api/contrib/test_share_actions.py b/manila/tests/api/contrib/test_share_actions.py index b24eac74..93019b36 100644 --- a/manila/tests/api/contrib/test_share_actions.py +++ b/manila/tests/api/contrib/test_share_actions.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.config import cfg +from oslo_config import cfg import webob from manila.api.contrib import share_actions diff --git a/manila/tests/api/fakes.py b/manila/tests/api/fakes.py index 19f99132..799664bf 100644 --- a/manila/tests/api/fakes.py +++ b/manila/tests/api/fakes.py @@ -15,7 +15,7 @@ import uuid -from oslo.utils import timeutils +from oslo_utils import timeutils import routes import six import webob diff --git a/manila/tests/api/middleware/test_faults.py b/manila/tests/api/middleware/test_faults.py index 763a1ce4..ba75bc44 100644 --- a/manila/tests/api/middleware/test_faults.py +++ b/manila/tests/api/middleware/test_faults.py @@ -15,7 +15,7 @@ from xml.dom import minidom -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import webob import webob.dec import webob.exc diff --git a/manila/tests/api/middleware/test_sizelimit.py b/manila/tests/api/middleware/test_sizelimit.py index 9f698743..9c18d9bb 100644 --- a/manila/tests/api/middleware/test_sizelimit.py +++ b/manila/tests/api/middleware/test_sizelimit.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.config import cfg +from oslo_config import cfg import six import webob diff --git a/manila/tests/api/test_extensions.py b/manila/tests/api/test_extensions.py index 307a0942..bb44010b 100644 --- a/manila/tests/api/test_extensions.py +++ b/manila/tests/api/test_extensions.py @@ -16,8 +16,8 @@ import iso8601 from lxml import etree -from oslo.config import cfg -from oslo.serialization import jsonutils +from oslo_config import cfg +from oslo_serialization import jsonutils import webob from manila.api.v1 import router diff --git a/manila/tests/api/test_router.py b/manila/tests/api/test_router.py index f6aee7e2..5c17b473 100644 --- a/manila/tests/api/test_router.py +++ b/manila/tests/api/test_router.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.config import cfg +from oslo_config import cfg from manila.api.openstack import wsgi from manila.api.v1 import router diff --git a/manila/tests/api/v1/test_limits.py b/manila/tests/api/v1/test_limits.py index 042b5362..3b0495f6 100644 --- a/manila/tests/api/v1/test_limits.py +++ b/manila/tests/api/v1/test_limits.py @@ -21,7 +21,7 @@ import httplib from xml.dom import minidom from lxml import etree -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six from six import moves import webob diff --git a/manila/tests/api/v1/test_share_metadata.py b/manila/tests/api/v1/test_share_metadata.py index e38cddfd..203abab1 100644 --- a/manila/tests/api/v1/test_share_metadata.py +++ b/manila/tests/api/v1/test_share_metadata.py @@ -16,8 +16,8 @@ import uuid import ddt -from oslo.config import cfg -from oslo.serialization import jsonutils +from oslo_config import cfg +from oslo_serialization import jsonutils import webob from manila.api.v1 import share_metadata diff --git a/manila/tests/api/v1/test_share_networks.py b/manila/tests/api/v1/test_share_networks.py index a9c71a9c..b41b5904 100644 --- a/manila/tests/api/v1/test_share_networks.py +++ b/manila/tests/api/v1/test_share_networks.py @@ -14,8 +14,8 @@ # under the License. import mock -from oslo.db import exception as db_exception -from oslo.utils import timeutils +from oslo_db import exception as db_exception +from oslo_utils import timeutils from six.moves.urllib import parse from webob import exc as webob_exc diff --git a/manila/tests/api/v1/test_volume_types.py b/manila/tests/api/v1/test_volume_types.py index d5a45e53..9dea5283 100644 --- a/manila/tests/api/v1/test_volume_types.py +++ b/manila/tests/api/v1/test_volume_types.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.utils import timeutils +from oslo_utils import timeutils import webob from manila.api.v1 import volume_types as types diff --git a/manila/tests/db/migrations/alembic/test_migration.py b/manila/tests/db/migrations/alembic/test_migration.py index ff8b0d45..ead4cf5a 100644 --- a/manila/tests/db/migrations/alembic/test_migration.py +++ b/manila/tests/db/migrations/alembic/test_migration.py @@ -19,8 +19,8 @@ Tests for database migrations. from alembic import script import mock -from oslo.db.sqlalchemy import test_base -from oslo.db.sqlalchemy import test_migrations +from oslo_db.sqlalchemy import test_base +from oslo_db.sqlalchemy import test_migrations from sqlalchemy.sql import text from manila.db.migrations.alembic import migration diff --git a/manila/tests/declare_conf.py b/manila/tests/declare_conf.py index 5f1e1ceb..7796d9d2 100644 --- a/manila/tests/declare_conf.py +++ b/manila/tests/declare_conf.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.config import cfg +from oslo_config import cfg CONF = cfg.CONF diff --git a/manila/tests/fake_compute.py b/manila/tests/fake_compute.py index 78d8263d..d5ce2682 100644 --- a/manila/tests/fake_compute.py +++ b/manila/tests/fake_compute.py @@ -14,7 +14,7 @@ # under the License. -from oslo.config import cfg +from oslo_config import cfg from manila.openstack.common import log as logging diff --git a/manila/tests/fake_network.py b/manila/tests/fake_network.py index 500d8f92..6ede2b66 100644 --- a/manila/tests/fake_network.py +++ b/manila/tests/fake_network.py @@ -15,7 +15,7 @@ import uuid -from oslo.config import cfg +from oslo_config import cfg from manila.openstack.common import log as logging diff --git a/manila/tests/fake_notifier.py b/manila/tests/fake_notifier.py index 0d83d580..53277c04 100644 --- a/manila/tests/fake_notifier.py +++ b/manila/tests/fake_notifier.py @@ -16,7 +16,7 @@ import collections import functools from oslo import messaging -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from manila import rpc diff --git a/manila/tests/fake_volume.py b/manila/tests/fake_volume.py index 31df6c31..375b6f73 100644 --- a/manila/tests/fake_volume.py +++ b/manila/tests/fake_volume.py @@ -14,7 +14,7 @@ # under the License. -from oslo.config import cfg +from oslo_config import cfg from manila.openstack.common import log as logging diff --git a/manila/tests/integrated/api/client.py b/manila/tests/integrated/api/client.py index 860d2851..f68d2d3a 100644 --- a/manila/tests/integrated/api/client.py +++ b/manila/tests/integrated/api/client.py @@ -14,7 +14,7 @@ import httplib -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from six.moves.urllib import parse from manila.openstack.common import log as logging diff --git a/manila/tests/integrated/integrated_helpers.py b/manila/tests/integrated/integrated_helpers.py index 40925546..d3a0151e 100644 --- a/manila/tests/integrated/integrated_helpers.py +++ b/manila/tests/integrated/integrated_helpers.py @@ -27,7 +27,7 @@ from manila import service from manila import test # For the flags from manila.tests.integrated.api import client -from oslo.config import cfg +from oslo_config import cfg CONF = cfg.CONF LOG = logging.getLogger(__name__) diff --git a/manila/tests/integrated/test_extensions.py b/manila/tests/integrated/test_extensions.py index 4d1772f8..37c74e96 100644 --- a/manila/tests/integrated/test_extensions.py +++ b/manila/tests/integrated/test_extensions.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.config import cfg +from oslo_config import cfg from manila.openstack.common import log as logging from manila.tests.integrated import integrated_helpers diff --git a/manila/tests/network/neutron/test_neutron_api.py b/manila/tests/network/neutron/test_neutron_api.py index a67c25d9..73bbe06f 100644 --- a/manila/tests/network/neutron/test_neutron_api.py +++ b/manila/tests/network/neutron/test_neutron_api.py @@ -17,7 +17,7 @@ import mock from neutronclient.common import exceptions as neutron_client_exc from neutronclient.v2_0 import client as clientv20 -from oslo.config import cfg +from oslo_config import cfg from manila import context from manila.db import base diff --git a/manila/tests/network/test_security_service_db.py b/manila/tests/network/test_security_service_db.py index 822a60e5..23a183a5 100644 --- a/manila/tests/network/test_security_service_db.py +++ b/manila/tests/network/test_security_service_db.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.db import exception as db_exception +from oslo_db import exception as db_exception from manila.common import constants from manila import context diff --git a/manila/tests/network/test_share_network_db.py b/manila/tests/network/test_share_network_db.py index 91f03b86..d56e850e 100644 --- a/manila/tests/network/test_share_network_db.py +++ b/manila/tests/network/test_share_network_db.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.db import exception as db_exception +from oslo_db import exception as db_exception import six from manila import context diff --git a/manila/tests/runtime_conf.py b/manila/tests/runtime_conf.py index 8f486f55..974db7e4 100644 --- a/manila/tests/runtime_conf.py +++ b/manila/tests/runtime_conf.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.config import cfg +from oslo_config import cfg CONF = cfg.CONF diff --git a/manila/tests/scheduler/fakes.py b/manila/tests/scheduler/fakes.py index fd229292..637289cd 100644 --- a/manila/tests/scheduler/fakes.py +++ b/manila/tests/scheduler/fakes.py @@ -16,7 +16,7 @@ Fakes For Scheduler tests. """ -from oslo.utils import timeutils +from oslo_utils import timeutils import six from manila.scheduler import filter_scheduler diff --git a/manila/tests/scheduler/test_capacity_weigher.py b/manila/tests/scheduler/test_capacity_weigher.py index 644409ce..40526e73 100644 --- a/manila/tests/scheduler/test_capacity_weigher.py +++ b/manila/tests/scheduler/test_capacity_weigher.py @@ -17,7 +17,7 @@ Tests For Capacity Weigher. """ import mock -from oslo.config import cfg +from oslo_config import cfg from manila import context from manila.openstack.common.scheduler import weights diff --git a/manila/tests/scheduler/test_host_filters.py b/manila/tests/scheduler/test_host_filters.py index 4f772b96..530a3e4a 100644 --- a/manila/tests/scheduler/test_host_filters.py +++ b/manila/tests/scheduler/test_host_filters.py @@ -15,7 +15,7 @@ Tests For Scheduler Host Filters. """ -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from manila import context from manila.openstack.common.scheduler import filters diff --git a/manila/tests/scheduler/test_host_manager.py b/manila/tests/scheduler/test_host_manager.py index f074f54c..be355a08 100644 --- a/manila/tests/scheduler/test_host_manager.py +++ b/manila/tests/scheduler/test_host_manager.py @@ -18,8 +18,8 @@ Tests For HostManager import datetime import mock -from oslo.config import cfg -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_utils import timeutils from six import moves from manila import db diff --git a/manila/tests/scheduler/test_rpcapi.py b/manila/tests/scheduler/test_rpcapi.py index 85709a04..02970484 100644 --- a/manila/tests/scheduler/test_rpcapi.py +++ b/manila/tests/scheduler/test_rpcapi.py @@ -19,7 +19,7 @@ Unit Tests for manila.scheduler.rpcapi import copy import mock -from oslo.config import cfg +from oslo_config import cfg from manila import context from manila.scheduler import rpcapi as scheduler_rpcapi diff --git a/manila/tests/scheduler/test_scheduler.py b/manila/tests/scheduler/test_scheduler.py index 3c26bd87..deaea9ec 100644 --- a/manila/tests/scheduler/test_scheduler.py +++ b/manila/tests/scheduler/test_scheduler.py @@ -18,8 +18,8 @@ Tests For Scheduler """ import mock -from oslo.config import cfg -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_utils import timeutils from manila import context from manila import db diff --git a/manila/tests/scheduler/test_scheduler_options.py b/manila/tests/scheduler/test_scheduler_options.py index 18d8e940..c7cb1302 100644 --- a/manila/tests/scheduler/test_scheduler_options.py +++ b/manila/tests/scheduler/test_scheduler_options.py @@ -18,7 +18,7 @@ Tests For PickledScheduler. import datetime -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six from manila.scheduler import scheduler_options diff --git a/manila/tests/share/drivers/emc/test_emc_vnx.py b/manila/tests/share/drivers/emc/test_emc_vnx.py index 61f56165..4494fd67 100644 --- a/manila/tests/share/drivers/emc/test_emc_vnx.py +++ b/manila/tests/share/drivers/emc/test_emc_vnx.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. import mock -from oslo.utils import units +from oslo_utils import units import manila.db from manila import exception diff --git a/manila/tests/share/drivers/ganesha/test_manager.py b/manila/tests/share/drivers/ganesha/test_manager.py index f0d615a3..315d0e34 100644 --- a/manila/tests/share/drivers/ganesha/test_manager.py +++ b/manila/tests/share/drivers/ganesha/test_manager.py @@ -17,7 +17,7 @@ import contextlib import re import mock -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils import six from manila import exception diff --git a/manila/tests/share/drivers/huawei/test_huawei_nas.py b/manila/tests/share/drivers/huawei/test_huawei_nas.py index da850435..202c69e4 100644 --- a/manila/tests/share/drivers/huawei/test_huawei_nas.py +++ b/manila/tests/share/drivers/huawei/test_huawei_nas.py @@ -23,7 +23,7 @@ import time import xml.dom.minidom import mock -from oslo.serialization import jsonutils +from oslo_serialization import jsonutils from manila import context from manila import exception diff --git a/manila/tests/share/drivers/ibm/test_ganesha_utils.py b/manila/tests/share/drivers/ibm/test_ganesha_utils.py index e5c973cc..a43aefc3 100644 --- a/manila/tests/share/drivers/ibm/test_ganesha_utils.py +++ b/manila/tests/share/drivers/ibm/test_ganesha_utils.py @@ -18,7 +18,7 @@ import socket import time import mock -from oslo.config import cfg +from oslo_config import cfg from manila import exception import manila.share.drivers.ibm.ganesha_utils as ganesha_utils diff --git a/manila/tests/share/drivers/ibm/test_gpfs.py b/manila/tests/share/drivers/ibm/test_gpfs.py index 119dae30..d3fa400a 100644 --- a/manila/tests/share/drivers/ibm/test_gpfs.py +++ b/manila/tests/share/drivers/ibm/test_gpfs.py @@ -18,7 +18,7 @@ import re import socket import mock -from oslo.config import cfg +from oslo_config import cfg from manila import context from manila import exception diff --git a/manila/tests/share/drivers/netapp/test_utils.py b/manila/tests/share/drivers/netapp/test_utils.py index a8d4a524..2c0313bc 100644 --- a/manila/tests/share/drivers/netapp/test_utils.py +++ b/manila/tests/share/drivers/netapp/test_utils.py @@ -15,7 +15,7 @@ import platform import mock -from oslo.concurrency import processutils as putils +from oslo_concurrency import processutils as putils from manila.share.drivers.netapp import utils as na_utils from manila import test diff --git a/manila/tests/share/drivers/test_ganesha.py b/manila/tests/share/drivers/test_ganesha.py index 5f4bc774..8597befe 100644 --- a/manila/tests/share/drivers/test_ganesha.py +++ b/manila/tests/share/drivers/test_ganesha.py @@ -18,7 +18,7 @@ import errno import os import mock -from oslo.config import cfg +from oslo_config import cfg from manila import exception from manila.share import configuration as config diff --git a/manila/tests/share/drivers/test_generic.py b/manila/tests/share/drivers/test_generic.py index 3aa7fb66..3e4fd006 100644 --- a/manila/tests/share/drivers/test_generic.py +++ b/manila/tests/share/drivers/test_generic.py @@ -18,8 +18,8 @@ import os import mock -from oslo.config import cfg from oslo_concurrency import processutils +from oslo_config import cfg from manila.common import constants as const from manila import compute diff --git a/manila/tests/share/drivers/test_glusterfs.py b/manila/tests/share/drivers/test_glusterfs.py index 5430a080..44095570 100644 --- a/manila/tests/share/drivers/test_glusterfs.py +++ b/manila/tests/share/drivers/test_glusterfs.py @@ -17,7 +17,7 @@ import errno import os import mock -from oslo.config import cfg +from oslo_config import cfg from manila import context from manila import exception diff --git a/manila/tests/share/drivers/test_glusterfs_native.py b/manila/tests/share/drivers/test_glusterfs_native.py index 2620a7cc..c3932062 100644 --- a/manila/tests/share/drivers/test_glusterfs_native.py +++ b/manila/tests/share/drivers/test_glusterfs_native.py @@ -23,7 +23,7 @@ import shutil import tempfile import mock -from oslo.config import cfg +from oslo_config import cfg from manila import context from manila import exception diff --git a/manila/tests/share/drivers/test_service_instance.py b/manila/tests/share/drivers/test_service_instance.py index 444ff549..4953eaee 100644 --- a/manila/tests/share/drivers/test_service_instance.py +++ b/manila/tests/share/drivers/test_service_instance.py @@ -19,7 +19,7 @@ import copy import os import mock -from oslo.config import cfg +from oslo_config import cfg import six from manila import context diff --git a/manila/tests/share/drivers/zfssa/test_zfssashare.py b/manila/tests/share/drivers/zfssa/test_zfssashare.py index d7c96975..803fe43a 100644 --- a/manila/tests/share/drivers/zfssa/test_zfssashare.py +++ b/manila/tests/share/drivers/zfssa/test_zfssashare.py @@ -15,7 +15,7 @@ Unit tests for Oracle's ZFSSA Manila driver. """ import mock -from oslo.config import cfg +from oslo_config import cfg from manila import context from manila import exception diff --git a/manila/tests/share/test_api.py b/manila/tests/share/test_api.py index 990ca571..657a9ad7 100644 --- a/manila/tests/share/test_api.py +++ b/manila/tests/share/test_api.py @@ -18,8 +18,12 @@ import datetime import uuid import mock -from oslo.config import cfg -from oslo.utils import timeutils +# NOTE(vponomaryov): import from oslo.utils.timeutils is workaround for +# mocking same object but from different namespaces. Remove it when all +# oslo libs use same namespace for same things. +from oslo.utils import timeutils as timeutils_old # noqa +from oslo_config import cfg +from oslo_utils import timeutils from manila import context from manila import db as db_driver @@ -168,15 +172,10 @@ class ShareAPITestCase(test.TestCase): self.stubs.Set(self.api, 'share_rpcapi', self.share_rpcapi) self.stubs.Set(quota.QUOTAS, 'reserve', lambda *args, **kwargs: None) - self.patcher = mock.patch.object(timeutils, 'utcnow') - self.mock_utcnow = self.patcher.start() - self.mock_utcnow.return_value = datetime.datetime.utcnow() - self.addCleanup(self.patcher.stop) - - self.policy_patcher = mock.patch.object(share_api.policy, - 'check_policy') - self.policy_patcher.start() - self.addCleanup(self.policy_patcher.stop) + dt_utc = datetime.datetime.utcnow() + self.stubs.Set(timeutils, 'utcnow', mock.Mock(return_value=dt_utc)) + self.stubs.Set(timeutils_old, 'utcnow', mock.Mock(return_value=dt_utc)) + self.stubs.Set(share_api.policy, 'check_policy', mock.Mock()) def test_get_all_admin_no_filters(self): self.stubs.Set(db_driver, 'share_get_all_by_project', @@ -417,7 +416,7 @@ class ShareAPITestCase(test.TestCase): def test_create(self): date = datetime.datetime(1, 1, 1, 1, 1, 1) - self.mock_utcnow.return_value = date + timeutils.utcnow.return_value = date share = fake_share('fakeid', user_id=self.context.user_id, project_id=self.context.project_id, @@ -435,7 +434,7 @@ class ShareAPITestCase(test.TestCase): def test_create_glusterfs(self): date = datetime.datetime(1, 1, 1, 1, 1, 1) - self.mock_utcnow.return_value = date + timeutils.utcnow.return_value = date share = fake_share('fakeid', user_id=self.context.user_id, project_id=self.context.project_id, @@ -457,7 +456,7 @@ class ShareAPITestCase(test.TestCase): @mock.patch.object(quota.QUOTAS, 'commit', mock.Mock()) def test_create_snapshot(self): date = datetime.datetime(1, 1, 1, 1, 1, 1) - self.mock_utcnow.return_value = date + timeutils.utcnow.return_value = date share = fake_share('fakeid', status='available') snapshot = fake_snapshot('fakesnapshotid', share_id=share['id'], @@ -519,7 +518,7 @@ class ShareAPITestCase(test.TestCase): @mock.patch.object(db_driver, 'share_snapshot_update', mock.Mock()) def test_delete_snapshot(self): date = datetime.datetime(1, 1, 1, 1, 1, 1) - self.mock_utcnow.return_value = date + timeutils.utcnow.return_value = date share = fake_share('fakeid') snapshot = fake_snapshot('fakesnapshotid', share_id=share['id'], @@ -564,7 +563,7 @@ class ShareAPITestCase(test.TestCase): def test_create_from_snapshot_available(self): CONF.set_default("use_scheduler_creating_share_from_snapshot", False) date = datetime.datetime(1, 1, 1, 1, 1, 1) - self.mock_utcnow.return_value = date + timeutils.utcnow.return_value = date snapshot = fake_snapshot('fakesnapshotid', share_id='fakeshare_id', status='available') @@ -611,7 +610,7 @@ class ShareAPITestCase(test.TestCase): def test_create_from_snapshot_without_host_restriction(self): CONF.set_default("use_scheduler_creating_share_from_snapshot", True) date = datetime.datetime(1, 1, 1, 1, 1, 1) - self.mock_utcnow.return_value = date + timeutils.utcnow.return_value = date snapshot = fake_snapshot('fakesnapshotid', share_id='fakeshare_id', status='available') @@ -659,7 +658,7 @@ class ShareAPITestCase(test.TestCase): # Prepare data for test CONF.set_default("use_scheduler_creating_share_from_snapshot", False) date = datetime.datetime(1, 1, 1, 1, 1, 1) - self.mock_utcnow.return_value = date + timeutils.utcnow.return_value = date share_id = 'fake_share_id' snapshot = fake_snapshot('fakesnapshotid', share_id=share_id, @@ -715,7 +714,7 @@ class ShareAPITestCase(test.TestCase): def test_create_from_snapshot_with_volume_type_different(self): # Prepare data for test date = datetime.datetime(1, 1, 1, 1, 1, 1) - self.mock_utcnow.return_value = date + timeutils.utcnow.return_value = date share_id = 'fake_share_id' snapshot = fake_snapshot('fakesnapshotid', share_id=share_id, @@ -787,7 +786,7 @@ class ShareAPITestCase(test.TestCase): def test_delete_available(self): date = datetime.datetime(2, 2, 2, 2, 2, 2) - self.mock_utcnow.return_value = date + timeutils.utcnow.return_value = date share = fake_share('fakeid', status='available') options = {'status': 'deleting', 'terminated_at': date} deleting_share = share.copy() @@ -802,7 +801,7 @@ class ShareAPITestCase(test.TestCase): def test_delete_error(self): date = datetime.datetime(2, 2, 2, 2, 2, 2) - self.mock_utcnow.return_value = date + timeutils.utcnow.return_value = date share = fake_share('fakeid', status='error') options = {'status': 'deleting', 'terminated_at': date} deleting_share = share.copy() diff --git a/manila/tests/share/test_manager.py b/manila/tests/share/test_manager.py index 421296ed..ab34c638 100644 --- a/manila/tests/share/test_manager.py +++ b/manila/tests/share/test_manager.py @@ -16,7 +16,7 @@ """Test of Share Manager for Manila.""" import mock -from oslo.utils import importutils +from oslo_utils import importutils from manila.common import constants from manila import context diff --git a/manila/tests/share/test_rpcapi.py b/manila/tests/share/test_rpcapi.py index c9e9768b..3ec6653d 100644 --- a/manila/tests/share/test_rpcapi.py +++ b/manila/tests/share/test_rpcapi.py @@ -18,8 +18,8 @@ Unit Tests for manila.share.rpcapi. import copy -from oslo.config import cfg -from oslo.serialization import jsonutils +from oslo_config import cfg +from oslo_serialization import jsonutils import six from manila import context diff --git a/manila/tests/test_conf.py b/manila/tests/test_conf.py index fc7807c0..6964d138 100644 --- a/manila/tests/test_conf.py +++ b/manila/tests/test_conf.py @@ -15,7 +15,7 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo.config import cfg +from oslo_config import cfg from manila import test diff --git a/manila/tests/test_db.py b/manila/tests/test_db.py index 02895934..629611b6 100644 --- a/manila/tests/test_db.py +++ b/manila/tests/test_db.py @@ -15,7 +15,7 @@ """Tests for the ShareServer and ShareServerBackendDetails tables.""" -from oslo.utils import uuidutils +from oslo_utils import uuidutils from manila import context from manila import db diff --git a/manila/tests/test_manager.py b/manila/tests/test_manager.py index a4d971ce..ab0b2c87 100644 --- a/manila/tests/test_manager.py +++ b/manila/tests/test_manager.py @@ -16,7 +16,7 @@ """Test of Base Manager for Manila.""" import mock -from oslo.utils import importutils +from oslo_utils import importutils from manila import manager from manila import test diff --git a/manila/tests/test_policy.py b/manila/tests/test_policy.py index 55daccb1..16a98e31 100644 --- a/manila/tests/test_policy.py +++ b/manila/tests/test_policy.py @@ -18,7 +18,7 @@ import os.path import mock -from oslo.config import cfg +from oslo_config import cfg import six from six.moves.urllib import request as urlrequest diff --git a/manila/tests/test_quota.py b/manila/tests/test_quota.py index 419bdc9f..438b7185 100644 --- a/manila/tests/test_quota.py +++ b/manila/tests/test_quota.py @@ -17,8 +17,8 @@ import datetime import mock -from oslo.config import cfg -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_utils import timeutils import testtools from manila import context diff --git a/manila/tests/test_service.py b/manila/tests/test_service.py index 7d1e2a93..ef172d4e 100644 --- a/manila/tests/test_service.py +++ b/manila/tests/test_service.py @@ -22,7 +22,7 @@ Unit Tests for remote procedure calls using queue """ import mock -from oslo.config import cfg +from oslo_config import cfg from manila import context from manila import db diff --git a/manila/tests/test_test.py b/manila/tests/test_test.py index dc2ba6d1..56daab7d 100644 --- a/manila/tests/test_test.py +++ b/manila/tests/test_test.py @@ -16,8 +16,8 @@ """Tests for the testing base code.""" -from oslo.config import cfg from oslo import messaging +from oslo_config import cfg from manila import rpc from manila import test diff --git a/manila/tests/test_utils.py b/manila/tests/test_utils.py index 47a91865..b53c6544 100644 --- a/manila/tests/test_utils.py +++ b/manila/tests/test_utils.py @@ -24,8 +24,8 @@ import tempfile import uuid import mock -from oslo.config import cfg -from oslo.utils import timeutils +from oslo_config import cfg +from oslo_utils import timeutils import paramiko import manila diff --git a/manila/tests/test_wsgi.py b/manila/tests/test_wsgi.py index cc7aed60..46113622 100644 --- a/manila/tests/test_wsgi.py +++ b/manila/tests/test_wsgi.py @@ -20,7 +20,7 @@ import os.path import tempfile import urllib2 -from oslo.config import cfg +from oslo_config import cfg import six import testtools import webob diff --git a/manila/tests/windows/windowsutils.py b/manila/tests/windows/windowsutils.py index df492e1d..742dde01 100644 --- a/manila/tests/windows/windowsutils.py +++ b/manila/tests/windows/windowsutils.py @@ -18,7 +18,7 @@ Windows storage classes to be used in testing. import os -from oslo.config import cfg +from oslo_config import cfg # Check needed for unit testing on Unix if os.name == 'nt': diff --git a/manila/utils.py b/manila/utils.py index 88cbd7b4..3b8070f9 100644 --- a/manila/utils.py +++ b/manila/utils.py @@ -33,11 +33,11 @@ from xml.sax import expatreader from eventlet import pools import netaddr -from oslo.config import cfg -from oslo.utils import importutils -from oslo.utils import timeutils from oslo_concurrency import lockutils from oslo_concurrency import processutils +from oslo_config import cfg +from oslo_utils import importutils +from oslo_utils import timeutils import paramiko import six diff --git a/manila/volume/__init__.py b/manila/volume/__init__.py index 7aa43eca..0675cc75 100644 --- a/manila/volume/__init__.py +++ b/manila/volume/__init__.py @@ -13,21 +13,21 @@ # License for the specific language governing permissions and limitations # under the License. -import oslo.config.cfg -import oslo.utils.importutils +import oslo_config.cfg +import oslo_utils.importutils _volume_opts = [ - oslo.config.cfg.StrOpt('volume_api_class', + oslo_config.cfg.StrOpt('volume_api_class', default='manila.volume.cinder.API', help='The full class name of the ' 'Volume API class to use.'), ] -oslo.config.cfg.CONF.register_opts(_volume_opts) +oslo_config.cfg.CONF.register_opts(_volume_opts) def API(): - importutils = oslo.utils.importutils - volume_api_class = oslo.config.cfg.CONF.volume_api_class + importutils = oslo_utils.importutils + volume_api_class = oslo_config.cfg.CONF.volume_api_class cls = importutils.import_class(volume_api_class) return cls() diff --git a/manila/volume/cinder.py b/manila/volume/cinder.py index 07e02b45..d0bff57d 100644 --- a/manila/volume/cinder.py +++ b/manila/volume/cinder.py @@ -23,7 +23,7 @@ import sys from cinderclient import exceptions as cinder_exception from cinderclient import service_catalog from cinderclient.v2 import client as cinder_client -from oslo.config import cfg +from oslo_config import cfg from manila.db import base from manila import exception diff --git a/manila/wsgi.py b/manila/wsgi.py index c57f332c..e9af441c 100644 --- a/manila/wsgi.py +++ b/manila/wsgi.py @@ -29,8 +29,8 @@ import time import eventlet import eventlet.wsgi import greenlet -from oslo.config import cfg -from oslo.utils import netutils +from oslo_config import cfg +from oslo_utils import netutils from paste import deploy import routes.middleware import six