Merge "Move from oslo.utils to oslo_utils"
This commit is contained in:
commit
ce7593172e
@ -16,8 +16,8 @@
|
||||
import re
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import units
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import units
|
||||
|
||||
from glance.common import exception
|
||||
from glance import i18n
|
||||
|
@ -23,8 +23,8 @@ import eventlet
|
||||
import glance_store as store
|
||||
import glance_store.location
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import strutils
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import strutils
|
||||
from webob.exc import HTTPBadRequest
|
||||
from webob.exc import HTTPConflict
|
||||
from webob.exc import HTTPForbidden
|
||||
|
@ -14,7 +14,7 @@
|
||||
# under the License.
|
||||
import glance_store as store_api
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import excutils
|
||||
from oslo_utils import excutils
|
||||
import webob.exc
|
||||
|
||||
from glance.common import exception
|
||||
|
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import glance_store
|
||||
from oslo.utils import excutils
|
||||
from oslo_utils import excutils
|
||||
import webob.exc
|
||||
|
||||
import glance.api.policy
|
||||
|
@ -17,7 +17,7 @@ import copy
|
||||
|
||||
import glance_store
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
import webob
|
||||
|
||||
|
@ -18,7 +18,7 @@ import re
|
||||
import glance_store
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils as json
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
import six.moves.urllib.parse as urlparse
|
||||
import webob.exc
|
||||
|
@ -35,7 +35,7 @@ class Namespace(types.Base, WSMEModelTransformer):
|
||||
owner = wsme.wsattr(types.text, mandatory=False)
|
||||
|
||||
# Not using datetime since time format has to be
|
||||
# in oslo.utils.timeutils.isotime() format
|
||||
# in oslo_utils.timeutils.isotime() format
|
||||
created_at = wsme.wsattr(types.text, mandatory=False)
|
||||
updated_at = wsme.wsattr(types.text, mandatory=False)
|
||||
|
||||
|
@ -28,7 +28,7 @@ class MetadefObject(types.Base, WSMEModelTransformer):
|
||||
properties = wsme.wsattr({types.text: PropertyType}, mandatory=False)
|
||||
|
||||
# Not using datetime since time format has to be
|
||||
# in oslo.utils.timeutils.isotime() format
|
||||
# in oslo_utils.timeutils.isotime() format
|
||||
created_at = wsme.wsattr(types.text, mandatory=False)
|
||||
updated_at = wsme.wsattr(types.text, mandatory=False)
|
||||
|
||||
|
@ -25,7 +25,7 @@ class ResourceTypeAssociation(types.Base, WSMEModelTransformer):
|
||||
properties_target = wsme.wsattr(types.text, mandatory=False)
|
||||
|
||||
# Not using datetime since time format has to be
|
||||
# in oslo.utils.timeutils.isotime() format
|
||||
# in oslo_utils.timeutils.isotime() format
|
||||
created_at = wsme.wsattr(types.text, mandatory=False)
|
||||
updated_at = wsme.wsattr(types.text, mandatory=False)
|
||||
|
||||
@ -46,7 +46,7 @@ class ResourceType(types.Base, WSMEModelTransformer):
|
||||
name = wsme.wsattr(types.text, mandatory=True)
|
||||
|
||||
# Not using datetime since time format has to be
|
||||
# in oslo.utils.timeutils.isotime() format
|
||||
# in oslo_utils.timeutils.isotime() format
|
||||
created_at = wsme.wsattr(types.text, mandatory=False)
|
||||
updated_at = wsme.wsattr(types.text, mandatory=False)
|
||||
|
||||
|
@ -24,7 +24,7 @@ class MetadefTag(types.Base, wsme_utils.WSMEModelTransformer):
|
||||
name = wsme.wsattr(types.text, mandatory=True)
|
||||
|
||||
# Not using datetime since time format has to be
|
||||
# in oslo.utils.timeutils.isotime() format
|
||||
# in oslo_utils.timeutils.isotime() format
|
||||
created_at = wsme.wsattr(types.text, mandatory=False)
|
||||
updated_at = wsme.wsattr(types.text, mandatory=False)
|
||||
|
||||
|
@ -19,7 +19,7 @@ import copy
|
||||
import glance_store
|
||||
from oslo.config import cfg
|
||||
import oslo.serialization.jsonutils as json
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
import six.moves.urllib.parse as urlparse
|
||||
import webob.exc
|
||||
|
@ -16,7 +16,7 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
import oslo.utils.strutils as strutils
|
||||
import oslo_utils.strutils as strutils
|
||||
|
||||
from glance import i18n
|
||||
|
||||
|
@ -26,7 +26,7 @@ import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from glance.common import utils
|
||||
|
||||
|
@ -40,7 +40,7 @@ if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
|
||||
sys.path.insert(0, possible_topdir)
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import units
|
||||
from oslo_utils import units
|
||||
from six.moves import xrange
|
||||
|
||||
from glance.common import config
|
||||
|
@ -40,7 +40,7 @@ if os.path.exists(os.path.join(possible_topdir, 'glance', '__init__.py')):
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.db.sqlalchemy import migration
|
||||
from oslo.utils import encodeutils
|
||||
from oslo_utils import encodeutils
|
||||
|
||||
from glance.common import config
|
||||
from glance.common import exception
|
||||
|
@ -40,7 +40,7 @@ try:
|
||||
except ImportError:
|
||||
SENDFILE_SUPPORTED = False
|
||||
|
||||
from oslo.utils import encodeutils
|
||||
from oslo_utils import encodeutils
|
||||
import six
|
||||
import six.moves.urllib.parse as urlparse
|
||||
from six.moves import xrange
|
||||
|
@ -20,8 +20,8 @@ import datetime
|
||||
import traceback
|
||||
|
||||
from oslo.config import cfg
|
||||
import oslo.utils.importutils as imp
|
||||
from oslo.utils import timeutils
|
||||
import oslo_utils.importutils as imp
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
from webob import exc
|
||||
|
||||
|
@ -17,8 +17,8 @@ __all__ = [
|
||||
'run',
|
||||
]
|
||||
|
||||
from oslo.utils import excutils
|
||||
from oslo_concurrency import lockutils
|
||||
from oslo_utils import excutils
|
||||
import six
|
||||
|
||||
from glance.api.v2 import images as v2_api
|
||||
|
@ -38,10 +38,10 @@ import uuid
|
||||
import netaddr
|
||||
from OpenSSL import crypto
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import encodeutils
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import netutils
|
||||
from oslo.utils import strutils
|
||||
from oslo_utils import encodeutils
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import netutils
|
||||
from oslo_utils import strutils
|
||||
import six
|
||||
from webob import exc
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
from wsme import types as wsme_types
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
# under the License.
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import importutils
|
||||
from oslo_utils import importutils
|
||||
from wsme.rest import json
|
||||
|
||||
from glance.api.v2.model.metadef_property_type import PropertyType
|
||||
|
@ -19,7 +19,7 @@ import datetime
|
||||
import functools
|
||||
import uuid
|
||||
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
|
||||
from glance.common import exception
|
||||
|
@ -25,7 +25,7 @@ import threading
|
||||
from oslo.config import cfg
|
||||
from oslo.db import exception as db_exception
|
||||
from oslo.db.sqlalchemy import session
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import osprofiler.sqlalchemy
|
||||
from retrying import retry
|
||||
import six
|
||||
|
@ -24,7 +24,7 @@ from os.path import join
|
||||
import re
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
import sqlalchemy
|
||||
from sqlalchemy.schema import MetaData
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import sqlalchemy
|
||||
from sqlalchemy.schema import (
|
||||
Column, ForeignKey, Index, MetaData, Table, UniqueConstraint) # noqa
|
||||
|
@ -22,7 +22,7 @@ import uuid
|
||||
|
||||
from oslo.db.sqlalchemy import models
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
from sqlalchemy import BigInteger
|
||||
from sqlalchemy import Boolean
|
||||
from sqlalchemy import Column
|
||||
|
@ -17,7 +17,7 @@ SQLAlchemy models for glance metadata schema
|
||||
"""
|
||||
|
||||
from oslo.db.sqlalchemy import models
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
from sqlalchemy import Boolean
|
||||
from sqlalchemy import Column
|
||||
from sqlalchemy import DateTime
|
||||
|
@ -19,9 +19,9 @@ import datetime
|
||||
import uuid
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import importutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import importutils
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
|
||||
from glance.common import exception
|
||||
|
@ -20,9 +20,9 @@ LRU Cache for Image Data
|
||||
import hashlib
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import importutils
|
||||
from oslo.utils import units
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import importutils
|
||||
from oslo_utils import units
|
||||
|
||||
from glance.common import exception
|
||||
from glance.common import utils
|
||||
|
@ -27,7 +27,7 @@ import time
|
||||
from eventlet import sleep
|
||||
from eventlet import timeout
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import excutils
|
||||
from oslo_utils import excutils
|
||||
|
||||
from glance.common import exception
|
||||
from glance import i18n
|
||||
|
@ -59,7 +59,7 @@ import stat
|
||||
import time
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import excutils
|
||||
from oslo_utils import excutils
|
||||
import xattr
|
||||
|
||||
from glance.common import exception
|
||||
|
@ -18,7 +18,7 @@ import copy
|
||||
|
||||
import glance_store as store
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import excutils
|
||||
from oslo_utils import excutils
|
||||
|
||||
from glance.common import exception
|
||||
from glance.common import utils
|
||||
|
@ -17,8 +17,8 @@
|
||||
import glance_store
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import timeutils
|
||||
import webob
|
||||
|
||||
from glance.common import exception
|
||||
|
@ -18,7 +18,7 @@ import errno
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
from oslo.utils import excutils
|
||||
from oslo_utils import excutils
|
||||
|
||||
from glance.openstack.common import log as logging
|
||||
|
||||
|
@ -39,7 +39,7 @@ import traceback
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import importutils
|
||||
from oslo_utils import importutils
|
||||
import six
|
||||
from six import moves
|
||||
|
||||
|
@ -16,7 +16,7 @@ import copy
|
||||
|
||||
import glance_store as store
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import excutils
|
||||
from oslo_utils import excutils
|
||||
import six
|
||||
|
||||
import glance.api.common
|
||||
|
@ -18,8 +18,8 @@ Reference implementation registry server WSGI controller
|
||||
"""
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import strutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import strutils
|
||||
from oslo_utils import timeutils
|
||||
from webob import exc
|
||||
|
||||
from glance.common import exception
|
||||
|
@ -19,7 +19,7 @@ the Glance Registry API
|
||||
"""
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import excutils
|
||||
from oslo_utils import excutils
|
||||
|
||||
from glance.common.client import BaseClient
|
||||
from glance.common import crypt
|
||||
|
@ -20,7 +20,7 @@ import datetime
|
||||
import uuid
|
||||
|
||||
import mock
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from glance.common import exception
|
||||
from glance import context
|
||||
|
@ -23,7 +23,7 @@ from __future__ import print_function
|
||||
import BaseHTTPServer
|
||||
import threading
|
||||
|
||||
from oslo.utils import units
|
||||
from oslo_utils import units
|
||||
|
||||
|
||||
FIVE_KB = 5 * units.Ki
|
||||
|
@ -22,7 +22,7 @@ import sys
|
||||
|
||||
import httplib2
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import units
|
||||
from oslo_utils import units
|
||||
from six.moves import xrange
|
||||
|
||||
from glance.tests import functional
|
||||
|
@ -28,7 +28,7 @@ import time
|
||||
|
||||
import httplib2
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import units
|
||||
from oslo_utils import units
|
||||
from six.moves import xrange
|
||||
|
||||
from glance.tests import functional
|
||||
|
@ -20,7 +20,7 @@ import time
|
||||
import glance_store.location
|
||||
import httplib2
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import units
|
||||
from oslo_utils import units
|
||||
from six.moves import xrange
|
||||
|
||||
from glance.common import crypt
|
||||
|
@ -19,7 +19,7 @@ import hashlib
|
||||
|
||||
import httplib2
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import units
|
||||
from oslo_utils import units
|
||||
|
||||
from glance.tests import functional
|
||||
from glance.tests.utils import minimal_headers
|
||||
|
@ -25,7 +25,7 @@ import time
|
||||
|
||||
import httplib2
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import units
|
||||
from oslo_utils import units
|
||||
from six.moves import xrange
|
||||
|
||||
from glance.tests import functional
|
||||
|
@ -17,7 +17,7 @@ import os
|
||||
|
||||
import httplib2
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import units
|
||||
from oslo_utils import units
|
||||
|
||||
from glance.tests import functional
|
||||
from glance.tests.utils import execute
|
||||
|
@ -35,8 +35,8 @@ import uuid
|
||||
|
||||
import httplib2
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo.utils import units
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import units
|
||||
|
||||
from glance.tests import functional
|
||||
from glance.tests.utils import minimal_headers
|
||||
|
@ -16,8 +16,8 @@ import os
|
||||
import tempfile
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo.utils import units
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import units
|
||||
import testtools
|
||||
|
||||
from glance.tests.integration.legacy_functional import base
|
||||
|
@ -16,7 +16,7 @@
|
||||
import time
|
||||
|
||||
from oslo.serialization import jsonutils as json
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from glance.api.v2 import tasks
|
||||
from glance.tests.integration.v2 import base
|
||||
|
@ -15,7 +15,7 @@
|
||||
# under the License.
|
||||
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import stubout
|
||||
import webob
|
||||
|
||||
|
@ -33,7 +33,7 @@ CONF = cfg.CONF
|
||||
CONF.import_opt('metadata_encryption_key', 'glance.common.config')
|
||||
|
||||
|
||||
@mock.patch('oslo.utils.importutils.import_module')
|
||||
@mock.patch('oslo_utils.importutils.import_module')
|
||||
class TestDbUtilities(test_utils.BaseTestCase):
|
||||
def setUp(self):
|
||||
super(TestDbUtilities, self).setUp()
|
||||
|
@ -19,8 +19,8 @@ import uuid
|
||||
|
||||
import mock
|
||||
from oslo.config import cfg
|
||||
import oslo.utils.importutils
|
||||
from oslo.utils import timeutils
|
||||
import oslo_utils.importutils
|
||||
from oslo_utils import timeutils
|
||||
|
||||
import glance.async
|
||||
from glance.common import exception
|
||||
@ -526,7 +526,7 @@ class TestTaskExecutorFactory(test_utils.BaseTestCase):
|
||||
self.image_repo,
|
||||
self.image_factory)
|
||||
context = mock.Mock()
|
||||
with mock.patch.object(oslo.utils.importutils,
|
||||
with mock.patch.object(oslo_utils.importutils,
|
||||
'import_class') as mock_import_class:
|
||||
mock_executor = mock.Mock()
|
||||
mock_import_class.return_value = mock_executor
|
||||
@ -542,7 +542,7 @@ class TestTaskExecutorFactory(test_utils.BaseTestCase):
|
||||
self.image_repo,
|
||||
self.image_factory)
|
||||
context = mock.Mock()
|
||||
with mock.patch.object(oslo.utils.importutils,
|
||||
with mock.patch.object(oslo_utils.importutils,
|
||||
'import_class') as mock_import_class:
|
||||
mock_import_class.side_effect = ImportError
|
||||
|
||||
|
@ -20,7 +20,7 @@ import os
|
||||
import time
|
||||
|
||||
import fixtures
|
||||
from oslo.utils import units
|
||||
from oslo_utils import units
|
||||
import six
|
||||
from six.moves import xrange
|
||||
import stubout
|
||||
|
@ -38,7 +38,7 @@ from oslo.db.sqlalchemy import test_base
|
||||
from oslo.db.sqlalchemy import test_migrations
|
||||
from oslo.db.sqlalchemy import utils as db_utils
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import sqlalchemy
|
||||
|
||||
from glance.common import crypt
|
||||
|
@ -20,7 +20,7 @@ import glance_store
|
||||
import mock
|
||||
from oslo.config import cfg
|
||||
from oslo import messaging
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import webob
|
||||
|
||||
import glance.async
|
||||
|
@ -16,7 +16,7 @@ import uuid
|
||||
|
||||
import mock
|
||||
from mock import patch
|
||||
from oslo.utils import units
|
||||
from oslo_utils import units
|
||||
import six
|
||||
|
||||
from glance.common import exception
|
||||
|
@ -25,7 +25,7 @@ import glance_store as store
|
||||
import mock
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import routes
|
||||
import six
|
||||
import webob
|
||||
|
@ -21,7 +21,7 @@ import uuid
|
||||
import mock
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import routes
|
||||
import six
|
||||
import webob
|
||||
|
@ -19,7 +19,7 @@ import os
|
||||
import uuid
|
||||
|
||||
from mock import patch
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import testtools
|
||||
|
||||
from glance.common import client as test_client
|
||||
|
@ -20,7 +20,7 @@ import uuid
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import routes
|
||||
import six
|
||||
import webob
|
||||
|
@ -25,7 +25,7 @@ import os
|
||||
import uuid
|
||||
|
||||
from mock import patch
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from glance.common import config
|
||||
from glance.common import exception
|
||||
|
@ -19,7 +19,7 @@ import uuid
|
||||
|
||||
import mock
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import webob
|
||||
|
||||
import glance.api.v2.tasks
|
||||
|
@ -26,7 +26,7 @@ import subprocess
|
||||
import fixtures
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
import stubout
|
||||
import testtools
|
||||
|
Loading…
Reference in New Issue
Block a user