Move oslo.utils to oslo_utils namespace

This is the fourth in a series of changes to move to using
the new oslo_<library> namespace that is being used for
oslo libraries.

There is currently a shim in place that is allowing the old
oslo.<library> imports to work, but we need to be prepared for
when the shims go away.  Thus, we need patches like this one to
move to the new namespace.

This patch also updates our hacking check to ensure that no instances
of oslo.utils sneak back in.

Change-Id: I19c331a9b54c5f42c278577ecc59fe1b65e61af0
This commit is contained in:
Jay S. Bryant 2015-01-16 16:54:27 -06:00
parent 09b1ff2091
commit b6ec77e6d4
181 changed files with 243 additions and 239 deletions

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.utils import strutils from oslo_utils import strutils
import webob import webob
from webob import exc from webob import exc

View File

@ -17,8 +17,8 @@
from xml.parsers import expat from xml.parsers import expat
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import timeutils
import webob.exc import webob.exc
from cinder.api import extensions from cinder.api import extensions

View File

@ -15,7 +15,7 @@
"""The QoS specs extension""" """The QoS specs extension"""
from oslo.utils import strutils from oslo_utils import strutils
import six import six
import webob import webob

View File

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.utils import strutils from oslo_utils import strutils
import webob import webob
from cinder.api import extensions from cinder.api import extensions

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import timeutils
import webob.exc import webob.exc
from cinder.api import extensions from cinder.api import extensions

View File

@ -14,7 +14,7 @@
from oslo import messaging from oslo import messaging
from oslo.utils import strutils from oslo_utils import strutils
import webob import webob
from cinder.api import extensions from cinder.api import extensions

View File

@ -16,8 +16,8 @@
import os import os
from oslo.utils import importutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
import webob.dec import webob.dec
import webob.exc import webob.exc

View File

@ -22,7 +22,7 @@ from xml.parsers import expat
from lxml import etree from lxml import etree
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
from oslo.utils import excutils from oslo_utils import excutils
import six import six
import webob import webob

View File

@ -25,7 +25,7 @@ import re
import time import time
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
from oslo.utils import importutils from oslo_utils import importutils
import webob.dec import webob.dec
import webob.exc import webob.exc

View File

@ -15,7 +15,7 @@
"""The volumes snapshots api.""" """The volumes snapshots api."""
from oslo.utils import strutils from oslo_utils import strutils
import webob import webob
from webob import exc from webob import exc

View File

@ -25,7 +25,7 @@ import re
import time import time
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
from oslo.utils import importutils from oslo_utils import importutils
import webob.dec import webob.dec
import webob.exc import webob.exc

View File

@ -15,7 +15,7 @@
"""The volumes snapshots api.""" """The volumes snapshots api."""
from oslo.utils import strutils from oslo_utils import strutils
import webob import webob
from webob import exc from webob import exc

View File

@ -15,7 +15,7 @@
"""The volume type & volume types extra specs extension.""" """The volume type & volume types extra specs extension."""
from oslo.utils import strutils from oslo_utils import strutils
from webob import exc from webob import exc
from cinder.api.openstack import wsgi from cinder.api.openstack import wsgi

View File

@ -15,7 +15,7 @@
import datetime import datetime
from oslo.utils import timeutils from oslo_utils import timeutils
class ViewBuilder(object): class ViewBuilder(object):

View File

@ -16,7 +16,7 @@
# Importing full names to not pollute the namespace and cause possible # Importing full names to not pollute the namespace and cause possible
# collisions with use of 'from cinder.backup import <foo>' elsewhere. # collisions with use of 'from cinder.backup import <foo>' elsewhere.
from oslo.utils import importutils from oslo_utils import importutils
from cinder.common import config from cinder.common import config

View File

@ -19,8 +19,8 @@ Handles all requests relating to the volume backups service.
from eventlet import greenthread from eventlet import greenthread
from oslo.utils import excutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import excutils
from cinder.backup import rpcapi as backup_rpcapi from cinder.backup import rpcapi as backup_rpcapi
from cinder import context from cinder import context

View File

@ -49,10 +49,10 @@ import subprocess
import time import time
import eventlet import eventlet
from oslo.utils import encodeutils
from oslo.utils import excutils
from oslo.utils import units
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import encodeutils
from oslo_utils import excutils
from oslo_utils import units
from cinder.backup.driver import BackupDriver from cinder.backup.driver import BackupDriver
from cinder import exception from cinder import exception

View File

@ -37,10 +37,10 @@ import os
import socket import socket
import eventlet import eventlet
from oslo.utils import excutils
from oslo.utils import timeutils
from oslo.utils import units
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import excutils
from oslo_utils import timeutils
from oslo_utils import units
import six import six
from swiftclient import client as swift from swiftclient import client as swift

View File

@ -34,9 +34,9 @@ Volume backups can be created, restored, deleted and listed.
""" """
from oslo import messaging from oslo import messaging
from oslo.utils import excutils
from oslo.utils import importutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import excutils
from oslo_utils import importutils
from cinder.backup import driver from cinder.backup import driver
from cinder.backup import rpcapi as backup_rpcapi from cinder.backup import rpcapi as backup_rpcapi

View File

@ -22,8 +22,8 @@ import math
import re import re
import time import time
from oslo.utils import excutils
from oslo_concurrency import processutils as putils from oslo_concurrency import processutils as putils
from oslo_utils import excutils
from cinder.brick import exception from cinder.brick import exception
from cinder.brick import executor from cinder.brick import executor

View File

@ -14,7 +14,7 @@
# under the License. # under the License.
import oslo.config.cfg import oslo.config.cfg
from oslo.utils import importutils from oslo_utils import importutils
_compute_opts = [ _compute_opts = [

View File

@ -16,7 +16,7 @@
# Importing full names to not pollute the namespace and cause possible # Importing full names to not pollute the namespace and cause possible
# collisions with use of 'from cinder.transfer import <foo>' elsewhere. # collisions with use of 'from cinder.transfer import <foo>' elsewhere.
from oslo.utils import importutils from oslo_utils import importutils
from cinder.common import config from cinder.common import config

View File

@ -20,9 +20,9 @@ Handles all requests relating to consistency groups.
import functools import functools
from oslo.utils import excutils
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import excutils
from oslo_utils import timeutils
from cinder.db import base from cinder.db import base
from cinder import exception from cinder import exception

View File

@ -19,8 +19,8 @@
import copy import copy
from oslo.utils import timeutils
from oslo_context import context from oslo_context import context
from oslo_utils import timeutils
from cinder.i18n import _ from cinder.i18n import _
from cinder.openstack.common import local from cinder.openstack.common import local

View File

@ -17,8 +17,8 @@
"""Base class for classes that need modular database access.""" """Base class for classes that need modular database access."""
from oslo.utils import importutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
db_driver_opt = cfg.StrOpt('db_driver', db_driver_opt = cfg.StrOpt('db_driver',

View File

@ -26,11 +26,11 @@ import time
import uuid import uuid
import warnings import warnings
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_db import exception as db_exc from oslo_db import exception as db_exc
from oslo_db import options from oslo_db import options
from oslo_db.sqlalchemy import session as db_session from oslo_db.sqlalchemy import session as db_session
from oslo_utils import timeutils
import osprofiler.sqlalchemy import osprofiler.sqlalchemy
import six import six
import sqlalchemy import sqlalchemy

View File

@ -19,9 +19,9 @@
SQLAlchemy models for cinder data. SQLAlchemy models for cinder data.
""" """
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_db.sqlalchemy import models from oslo_db.sqlalchemy import models
from oslo_utils import timeutils
from sqlalchemy import Column, Integer, String, Text, schema from sqlalchemy import Column, Integer, String, Text, schema
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import ForeignKey, DateTime, Boolean from sqlalchemy import ForeignKey, DateTime, Boolean

View File

@ -44,7 +44,7 @@ no_audit_log = re.compile(r"(.)*LOG\.audit(.)*")
# NOTE(jsbryant): When other oslo libraries switch over non-namespaced # NOTE(jsbryant): When other oslo libraries switch over non-namespaced
# imports, we will need to add them to the regex below. # imports, we will need to add them to the regex below.
oslo_namespace_imports = re.compile(r"from[\s]*oslo[.](concurrency|db" oslo_namespace_imports = re.compile(r"from[\s]*oslo[.](concurrency|db"
"|config)") "|config|utils)")
def no_vi_headers(physical_line, line_number, lines): def no_vi_headers(physical_line, line_number, lines):

View File

@ -28,8 +28,8 @@ import time
import glanceclient.exc import glanceclient.exc
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import timeutils
import six.moves.urllib.parse as urlparse import six.moves.urllib.parse as urlparse
from cinder import exception from cinder import exception

View File

@ -28,10 +28,10 @@ import contextlib
import os import os
import tempfile import tempfile
from oslo.utils import timeutils
from oslo.utils import units
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import timeutils
from oslo_utils import units
from cinder import exception from cinder import exception
from cinder.i18n import _ from cinder.i18n import _

View File

@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.utils import importutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
keymgr_opts = [ keymgr_opts = [
cfg.StrOpt('api_class', cfg.StrOpt('api_class',

View File

@ -24,8 +24,8 @@ import binascii
from barbicanclient import client as barbican_client from barbicanclient import client as barbican_client
from keystoneclient.auth import identity from keystoneclient.auth import identity
from keystoneclient import session from keystoneclient import session
from oslo.utils import excutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import excutils
from cinder import exception from cinder import exception
from cinder.i18n import _, _LE from cinder.i18n import _, _LE

View File

@ -19,9 +19,9 @@
import datetime import datetime
from oslo.utils import importutils
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
from oslo_utils import timeutils
from cinder import context from cinder import context
from cinder import db from cinder import db

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
from oslo.utils import importutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
CONF = cfg.CONF CONF = cfg.CONF

View File

@ -19,9 +19,9 @@
Scheduler base class that all Schedulers should inherit from Scheduler base class that all Schedulers should inherit from
""" """
from oslo.utils import importutils
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
from oslo_utils import timeutils
from cinder import db from cinder import db
from cinder.i18n import _ from cinder.i18n import _

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.utils import excutils from oslo_utils import excutils
import taskflow.engines import taskflow.engines
from taskflow.patterns import linear_flow from taskflow.patterns import linear_flow

View File

@ -19,8 +19,8 @@ Manage hosts in the current zone.
import UserDict import UserDict
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import timeutils
from cinder import db from cinder import db
from cinder import exception from cinder import exception

View File

@ -20,9 +20,9 @@ Scheduler Service
""" """
from oslo import messaging from oslo import messaging
from oslo.utils import excutils
from oslo.utils import importutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import excutils
from oslo_utils import importutils
from cinder import context from cinder import context
from cinder import db from cinder import db

View File

@ -24,8 +24,8 @@ import datetime
import json import json
import os import os
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import timeutils
from cinder.i18n import _LE from cinder.i18n import _LE
from cinder.openstack.common import log as logging from cinder.openstack.common import log as logging

View File

@ -23,10 +23,10 @@ import os
import random import random
from oslo import messaging from oslo import messaging
from oslo.utils import importutils
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_config import cfg from oslo_config import cfg
from oslo_db import exception as db_exc from oslo_db import exception as db_exc
from oslo_utils import importutils
import osprofiler.notifier import osprofiler.notifier
from osprofiler import profiler from osprofiler import profiler
import osprofiler.web import osprofiler.web

View File

@ -30,11 +30,11 @@ import fixtures
import mock import mock
import mox import mox
from oslo.messaging import conffixture as messaging_conffixture from oslo.messaging import conffixture as messaging_conffixture
from oslo.utils import strutils
from oslo.utils import timeutils
from oslo_concurrency import lockutils from oslo_concurrency import lockutils
from oslo_config import cfg from oslo_config import cfg
from oslo_config import fixture as config_fixture from oslo_config import fixture as config_fixture
from oslo_utils import strutils
from oslo_utils import timeutils
import stubout import stubout
import testtools import testtools

View File

@ -14,10 +14,10 @@ import ast
import fixtures import fixtures
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
from oslo.utils import timeutils
from oslo_concurrency import lockutils from oslo_concurrency import lockutils
from oslo_config import cfg from oslo_config import cfg
from oslo_config import fixture as config_fixture from oslo_config import fixture as config_fixture
from oslo_utils import timeutils
import webob import webob
from webob import exc from webob import exc

View File

@ -16,7 +16,7 @@
import datetime import datetime
from lxml import etree from lxml import etree
from oslo.utils import timeutils from oslo_utils import timeutils
import cinder.api.contrib.availability_zones import cinder.api.contrib.availability_zones
import cinder.context import cinder.context

View File

@ -21,7 +21,7 @@ import json
from xml.dom import minidom from xml.dom import minidom
import mock import mock
from oslo.utils import timeutils from oslo_utils import timeutils
import webob import webob
# needed for stubs to work # needed for stubs to work

View File

@ -16,7 +16,7 @@
import datetime import datetime
from lxml import etree from lxml import etree
from oslo.utils import timeutils from oslo_utils import timeutils
import webob.exc import webob.exc
from cinder.api.contrib import hosts as os_hosts from cinder.api.contrib import hosts as os_hosts

View File

@ -16,7 +16,7 @@
from datetime import datetime from datetime import datetime
from oslo.utils import timeutils from oslo_utils import timeutils
import webob.exc import webob.exc
from cinder.api.contrib import services from cinder.api.contrib import services

View File

@ -15,7 +15,7 @@
import uuid import uuid
from oslo.utils import timeutils from oslo_utils import timeutils
import routes import routes
import webob import webob
import webob.dec import webob.dec

View File

@ -16,7 +16,7 @@
import uuid import uuid
from lxml import etree from lxml import etree
from oslo.utils import timeutils from oslo_utils import timeutils
import webob import webob
from cinder.api.v1 import types from cinder.api.v1 import types

View File

@ -16,7 +16,7 @@
import uuid import uuid
from lxml import etree from lxml import etree
from oslo.utils import timeutils from oslo_utils import timeutils
import six import six
import webob import webob

View File

@ -13,7 +13,7 @@
# under the License. # under the License.
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
from oslo.utils import netutils from oslo_utils import netutils
import requests import requests
import six.moves.urllib.parse as urlparse import six.moves.urllib.parse as urlparse

View File

@ -16,7 +16,7 @@
Fakes For Scheduler tests. Fakes For Scheduler tests.
""" """
from oslo.utils import timeutils from oslo_utils import timeutils
from cinder.openstack.common import uuidutils from cinder.openstack.common import uuidutils
from cinder.scheduler import filter_scheduler from cinder.scheduler import filter_scheduler

View File

@ -17,8 +17,8 @@ Tests For HostManager
""" """
import mock import mock
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import timeutils
from cinder import exception from cinder import exception
from cinder.openstack.common.scheduler import filters from cinder.openstack.common.scheduler import filters
@ -84,7 +84,7 @@ class HostManagerTestCase(test.TestCase):
self.assertEqual(expected, mock_func.call_args_list) self.assertEqual(expected, mock_func.call_args_list)
self.assertEqual(set(result), set(self.fake_hosts)) self.assertEqual(set(result), set(self.fake_hosts))
@mock.patch('oslo.utils.timeutils.utcnow') @mock.patch('oslo_utils.timeutils.utcnow')
def test_update_service_capabilities(self, _mock_utcnow): def test_update_service_capabilities(self, _mock_utcnow):
service_states = self.host_manager.service_states service_states = self.host_manager.service_states
self.assertDictMatch(service_states, {}) self.assertDictMatch(service_states, {})
@ -118,7 +118,7 @@ class HostManagerTestCase(test.TestCase):
@mock.patch('cinder.db.service_get_all_by_topic') @mock.patch('cinder.db.service_get_all_by_topic')
@mock.patch('cinder.utils.service_is_up') @mock.patch('cinder.utils.service_is_up')
@mock.patch('oslo.utils.timeutils.utcnow') @mock.patch('oslo_utils.timeutils.utcnow')
def test_update_and_get_pools(self, _mock_utcnow, def test_update_and_get_pools(self, _mock_utcnow,
_mock_service_is_up, _mock_service_is_up,
_mock_service_get_all_by_topic): _mock_service_get_all_by_topic):

View File

@ -278,7 +278,7 @@ class SchedulerDriverModuleTestCase(test.TestCase):
self.context = context.RequestContext('fake_user', 'fake_project') self.context = context.RequestContext('fake_user', 'fake_project')
@mock.patch('cinder.db.volume_update') @mock.patch('cinder.db.volume_update')
@mock.patch('oslo.utils.timeutils.utcnow') @mock.patch('oslo_utils.timeutils.utcnow')
def test_volume_host_update_db(self, _mock_utcnow, _mock_vol_update): def test_volume_host_update_db(self, _mock_utcnow, _mock_vol_update):
_mock_utcnow.return_value = 'fake-now' _mock_utcnow.return_value = 'fake-now'
driver.volume_update_db(self.context, 31337, 'fake_host') driver.volume_update_db(self.context, 31337, 'fake_host')

View File

@ -10,8 +10,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import timeutils
from cinder import exception from cinder import exception
from cinder import test from cinder import test

View File

@ -14,8 +14,8 @@ import os
import tempfile import tempfile
import mock import mock
from oslo.utils import timeutils
from oslo_concurrency import processutils as putils from oslo_concurrency import processutils as putils
from oslo_utils import timeutils
from cinder import context from cinder import context
from cinder import test from cinder import test

View File

@ -20,9 +20,9 @@ Tests for Backup code.
import tempfile import tempfile
import mock import mock
from oslo.utils import importutils
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
from oslo_utils import timeutils
from cinder.backup import manager from cinder.backup import manager
from cinder import context from cinder import context

View File

@ -19,8 +19,8 @@ import math
import mock import mock
import mox import mox
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
from oslo.utils import units
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import units
from cinder.brick.initiator import connector from cinder.brick.initiator import connector
from cinder import exception from cinder import exception

View File

@ -16,8 +16,8 @@
import collections import collections
import mock import mock
from oslo.utils import importutils from oslo_utils import importutils
from oslo.utils import timeutils from oslo_utils import timeutils
from cinder import context from cinder import context
from cinder.openstack.common import log as logging from cinder.openstack.common import log as logging

View File

@ -17,8 +17,8 @@ import copy
import json import json
import mock import mock
from oslo.utils import timeutils from oslo_utils import timeutils
from oslo.utils import units from oslo_utils import units
import requests import requests
from cinder import context from cinder import context

View File

@ -21,9 +21,9 @@ import time
import traceback import traceback
import mock import mock
from oslo.utils import units
from oslo_concurrency import processutils as putils from oslo_concurrency import processutils as putils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import units
from cinder import brick from cinder import brick
from cinder import compute from cinder import compute

View File

@ -18,9 +18,9 @@ import shutil
import tempfile import tempfile
import mock import mock
from oslo.utils import units
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import units
from cinder import context from cinder import context
from cinder import exception from cinder import exception

View File

@ -151,3 +151,7 @@ class HackingTestCase(test.TestCase):
"from oslo.config import foo")))) "from oslo.config import foo"))))
self.assertEqual(0, len(list(checks.check_oslo_namespace_imports( self.assertEqual(0, len(list(checks.check_oslo_namespace_imports(
"from oslo_config import bar")))) "from oslo_config import bar"))))
self.assertEqual(1, len(list(checks.check_oslo_namespace_imports(
"from oslo.utils import foo"))))
self.assertEqual(0, len(list(checks.check_oslo_namespace_imports(
"from oslo_utils import bar"))))

View File

@ -19,8 +19,8 @@ import mock
import ast import ast
from oslo.utils import units
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import units
from cinder import context from cinder import context
from cinder import exception from cinder import exception

View File

@ -15,7 +15,7 @@
# #
"""Unit tests for OpenStack Cinder volume drivers.""" """Unit tests for OpenStack Cinder volume drivers."""
import mock import mock
from oslo.utils import units from oslo_utils import units
from cinder import context from cinder import context
from cinder import exception from cinder import exception

View File

@ -13,8 +13,8 @@
# under the License. # under the License.
from oslo.utils import importutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
from cinder import context from cinder import context
from cinder import test from cinder import test

View File

@ -23,7 +23,7 @@ import re
import tempfile import tempfile
from xml.dom.minidom import Document from xml.dom.minidom import Document
from oslo.utils import units from oslo_utils import units
from cinder.brick.initiator import connector as brick_connector from cinder.brick.initiator import connector as brick_connector
from cinder import exception from cinder import exception

View File

@ -20,9 +20,9 @@ Tests for the IBM FlashSystem volume driver.
""" """
import mock import mock
from oslo.utils import excutils
from oslo.utils import units
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_utils import excutils
from oslo_utils import units
import six import six
import random import random

View File

@ -22,8 +22,8 @@ NAS based IBM GPFS Storage Systems).
""" """
import mock import mock
from oslo.utils import units
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import units
from cinder import context from cinder import context
from cinder import exception from cinder import exception

View File

@ -21,7 +21,7 @@ import base64
import urllib2 import urllib2
import mox as mox_lib import mox as mox_lib
from oslo.utils import units from oslo_utils import units
from cinder import context from cinder import context
from cinder import db from cinder import db

View File

@ -23,7 +23,7 @@ import mox as mox_lib
from mox import IgnoreArg from mox import IgnoreArg
from mox import IsA from mox import IsA
from mox import stubout from mox import stubout
from oslo.utils import units from oslo_utils import units
from cinder import context from cinder import context
from cinder import exception from cinder import exception

View File

@ -18,7 +18,7 @@ import httplib
import re import re
import mock import mock
from oslo.utils import units from oslo_utils import units
from cinder import exception from cinder import exception
from cinder import test from cinder import test

View File

@ -14,8 +14,8 @@
# under the License. # under the License.
import mock import mock
from oslo.utils import units
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_utils import units
from cinder import exception from cinder import exception
from cinder import test from cinder import test

View File

@ -26,9 +26,9 @@ import mox as mox_lib
from mox import IgnoreArg from mox import IgnoreArg
from mox import IsA from mox import IsA
from mox import stubout from mox import stubout
from oslo.utils import units
from oslo_concurrency import processutils as putils from oslo_concurrency import processutils as putils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import units
from cinder import context from cinder import context
from cinder import exception from cinder import exception

View File

@ -19,8 +19,8 @@
import datetime import datetime
import mock import mock
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import timeutils
from cinder import backup from cinder import backup
from cinder import context from cinder import context

View File

@ -21,8 +21,8 @@ import os
import tempfile import tempfile
import mock import mock
from oslo.utils import timeutils from oslo_utils import timeutils
from oslo.utils import units from oslo_utils import units
from cinder import db from cinder import db
from cinder import exception from cinder import exception

View File

@ -16,8 +16,8 @@ Tests for Volume replication code.
""" """
import mock import mock
from oslo.utils import importutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
from cinder import context from cinder import context
from cinder import db from cinder import db

View File

@ -22,7 +22,7 @@ import shutil
import tempfile import tempfile
import mox as mox_lib import mox as mox_lib
from oslo.utils import units from oslo_utils import units
from cinder import context from cinder import context
from cinder import exception from cinder import exception

View File

@ -18,8 +18,8 @@
import contextlib import contextlib
import mock import mock
from oslo.utils import units
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_utils import units
from cinder.image import image_utils from cinder.image import image_utils
from cinder import test from cinder import test

View File

@ -18,8 +18,8 @@ import datetime
import mock import mock
import mox import mox
from oslo.utils import timeutils from oslo_utils import timeutils
from oslo.utils import units from oslo_utils import units
from cinder import context from cinder import context
from cinder import exception from cinder import exception

View File

@ -17,8 +17,8 @@ Unit tests for the Scality Rest Block Volume Driver.
""" """
import mock import mock
from oslo.utils import units
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_utils import units
from cinder import context from cinder import context
from cinder import exception from cinder import exception

View File

@ -18,7 +18,7 @@ import re
import sys import sys
import mock import mock
from oslo.utils import units from oslo_utils import units
fakeStorPool = mock.Mock() fakeStorPool = mock.Mock()

View File

@ -23,10 +23,10 @@ import re
import time import time
import mock import mock
from oslo.utils import excutils
from oslo.utils import importutils
from oslo.utils import units
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_utils import excutils
from oslo_utils import importutils
from oslo_utils import units
from cinder import context from cinder import context
from cinder import exception from cinder import exception

View File

@ -19,9 +19,9 @@ import os
import uuid import uuid
import mock import mock
from oslo.utils import timeutils
from oslo_concurrency import processutils as putils from oslo_concurrency import processutils as putils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import timeutils
import paramiko import paramiko
import six import six
@ -353,7 +353,7 @@ class GenericUtilsTestCase(test.TestCase):
utils.read_file_as_root, utils.read_file_as_root,
test_filepath) test_filepath)
@mock.patch('oslo.utils.timeutils.utcnow') @mock.patch('oslo_utils.timeutils.utcnow')
def test_service_is_up(self, mock_utcnow): def test_service_is_up(self, mock_utcnow):
fts_func = datetime.datetime.fromtimestamp fts_func = datetime.datetime.fromtimestamp
fake_now = 1000 fake_now = 1000
@ -893,7 +893,7 @@ class AuditPeriodTest(test.TestCase):
month=2, month=2,
year=2012)) year=2012))
@mock.patch('oslo.utils.timeutils.utcnow', @mock.patch('oslo_utils.timeutils.utcnow',
return_value=datetime.datetime(day=1, return_value=datetime.datetime(day=1,
month=1, month=1,
year=2012)) year=2012))
@ -902,7 +902,7 @@ class AuditPeriodTest(test.TestCase):
self.assertEqual(datetime.datetime(day=1, month=11, year=2011), begin) self.assertEqual(datetime.datetime(day=1, month=11, year=2011), begin)
self.assertEqual(datetime.datetime(day=1, month=12, year=2011), end) self.assertEqual(datetime.datetime(day=1, month=12, year=2011), end)
@mock.patch('oslo.utils.timeutils.utcnow', @mock.patch('oslo_utils.timeutils.utcnow',
return_value=datetime.datetime(day=2, return_value=datetime.datetime(day=2,
month=1, month=1,
year=2012)) year=2012))

View File

@ -18,7 +18,7 @@ Tests for Violin Memory 6000 Series All-Flash Array Fibrechannel Driver
""" """
import mock import mock
from oslo.utils import units from oslo_utils import units
from cinder import context from cinder import context
from cinder.db.sqlalchemy import models from cinder.db.sqlalchemy import models

View File

@ -18,7 +18,7 @@ Tests for Violin Memory 6000 Series All-Flash Array iSCSI driver
""" """
import mock import mock
from oslo.utils import units from oslo_utils import units
from cinder import context from cinder import context
from cinder.db.sqlalchemy import models from cinder.db.sqlalchemy import models

View File

@ -18,7 +18,7 @@ Unit tests for datastore module.
""" """
import mock import mock
from oslo.utils import units from oslo_utils import units
from cinder import test from cinder import test
from cinder.volume.drivers.vmware import datastore as ds_sel from cinder.volume.drivers.vmware import datastore as ds_sel

View File

@ -22,7 +22,7 @@ import os
import mock import mock
import mox import mox
from oslo.utils import units from oslo_utils import units
from cinder import exception from cinder import exception
from cinder.image import glance from cinder.image import glance

View File

@ -18,7 +18,7 @@ Test suite for VMware VMDK driver volumeops module.
""" """
import mock import mock
from oslo.utils import units from oslo_utils import units
from cinder import test from cinder import test
from cinder.volume.drivers.vmware import error_util from cinder.volume.drivers.vmware import error_util

View File

@ -30,10 +30,10 @@ import eventlet
import mock import mock
import mox import mox
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
from oslo.utils import importutils
from oslo.utils import timeutils
from oslo.utils import units
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
from oslo_utils import timeutils
from oslo_utils import units
from stevedore import extension from stevedore import extension
from taskflow.engines.action_engine import engine from taskflow.engines.action_engine import engine

View File

@ -19,7 +19,7 @@ import mock
from json import JSONEncoder from json import JSONEncoder
from oslo.utils import units from oslo_utils import units
from cinder.openstack.common import log as logging from cinder.openstack.common import log as logging
from cinder import test from cinder import test

View File

@ -20,8 +20,8 @@
"""Unit tests for Brocade fc zone driver.""" """Unit tests for Brocade fc zone driver."""
import mock import mock
from oslo.utils import importutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
import paramiko import paramiko
from cinder import exception from cinder import exception

View File

@ -17,9 +17,9 @@
"""Unit tests for Cisco FC zone driver.""" """Unit tests for Cisco FC zone driver."""
from oslo.utils import importutils
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
from cinder import exception from cinder import exception
from cinder import test from cinder import test

View File

@ -17,8 +17,8 @@
# collisions with use of 'from cinder.transfer import <foo>' elsewhere. # collisions with use of 'from cinder.transfer import <foo>' elsewhere.
from oslo.utils import importutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
CONF = cfg.CONF CONF = cfg.CONF

View File

@ -22,8 +22,8 @@ import hashlib
import hmac import hmac
import os import os
from oslo.utils import excutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import excutils
from cinder.db import base from cinder.db import base
from cinder import exception from cinder import exception

View File

@ -35,11 +35,11 @@ from xml import sax
from xml.sax import expatreader from xml.sax import expatreader
from xml.sax import saxutils from xml.sax import saxutils
from oslo.utils import importutils
from oslo.utils import timeutils
from oslo_concurrency import lockutils from oslo_concurrency import lockutils
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
from oslo_utils import timeutils
import six import six
from cinder.brick.initiator import connector from cinder.brick.initiator import connector

View File

@ -17,7 +17,7 @@
# Importing full names to not pollute the namespace and cause possible # Importing full names to not pollute the namespace and cause possible
# collisions with use of 'from cinder.volume import <foo>' elsewhere. # collisions with use of 'from cinder.volume import <foo>' elsewhere.
from oslo.utils import importutils from oslo_utils import importutils
from cinder.common import config from cinder.common import config

View File

@ -23,9 +23,9 @@ import collections
import datetime import datetime
import functools import functools
from oslo.utils import excutils
from oslo.utils import timeutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import excutils
from oslo_utils import timeutils
import six import six
from cinder import context from cinder import context

View File

@ -19,9 +19,9 @@ Drivers for volumes.
import time import time
from oslo.utils import excutils
from oslo_concurrency import processutils from oslo_concurrency import processutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import excutils
from cinder import exception from cinder import exception
from cinder.i18n import _, _LE, _LW from cinder.i18n import _, _LE, _LW

View File

@ -15,8 +15,8 @@
import os import os
from oslo.utils import importutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import importutils
from cinder import context from cinder import context
from cinder.db.sqlalchemy import api from cinder.db.sqlalchemy import api

View File

@ -27,9 +27,9 @@ import urllib
import urllib2 import urllib2
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
from oslo.utils import units
from oslo_concurrency import lockutils from oslo_concurrency import lockutils
from oslo_config import cfg from oslo_config import cfg
from oslo_utils import units
import six.moves.urllib.parse as urlparse import six.moves.urllib.parse as urlparse
from cinder import exception from cinder import exception

Some files were not shown because too many files have changed in this diff Show More