# under the License.
from oslo_config import cfg
+from oslo_utils import uuidutils
from webob import exc
from cinder.api import extensions
from cinder import exception
from cinder.i18n import _
from cinder.openstack.common import log as logging
-from cinder.openstack.common import uuidutils
from cinder import utils
from cinder import volume as cinder_volume
from cinder.volume import volume_types
"""The volume type access extension."""
+from oslo_utils import uuidutils
import six
import webob
from cinder.api import xmlutil
from cinder import exception
from cinder.i18n import _
-from cinder.openstack.common import uuidutils
from cinder.volume import volume_types
import ast
+from oslo_utils import uuidutils
import webob
from webob import exc
from cinder import exception
from cinder.i18n import _, _LI
from cinder.openstack.common import log as logging
-from cinder.openstack.common import uuidutils
from cinder import utils
from cinder import volume as cinder_volume
from cinder.volume import utils as volume_utils
import ast
+from oslo_utils import uuidutils
import webob
from webob import exc
from cinder.i18n import _, _LI
from cinder.image import glance
from cinder.openstack.common import log as logging
-from cinder.openstack.common import uuidutils
from cinder import utils
from cinder import volume as cinder_volume
from cinder.volume import utils as volume_utils
from oslo import messaging
from oslo_config import cfg
from oslo_db.sqlalchemy import migration
+from oslo_utils import uuidutils
from cinder import i18n
i18n.enable_lazy()
from cinder.db.sqlalchemy import api as db_api
from cinder.i18n import _
from cinder.openstack.common import log as logging
-from cinder.openstack.common import uuidutils
from cinder import rpc
from cinder import utils
from cinder import version
from oslo_db import options
from oslo_db.sqlalchemy import session as db_session
from oslo_utils import timeutils
+from oslo_utils import uuidutils
import osprofiler.sqlalchemy
import six
import sqlalchemy
from cinder import exception
from cinder.i18n import _, _LW
from cinder.openstack.common import log as logging
-from cinder.openstack.common import uuidutils
CONF = cfg.CONF
+++ /dev/null
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright (c) 2012 Intel Corporation.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-"""
-UUID related utilities and helper functions.
-"""
-
-import uuid
-
-
-def generate_uuid():
- return str(uuid.uuid4())
-
-
-def is_uuid_like(val):
- """Returns validation of a value as a UUID.
-
- For our purposes, a UUID is a canonical form string:
- aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
-
- """
- try:
- return str(uuid.UUID(val)) == val
- except (TypeError, ValueError, AttributeError):
- return False
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
+from oslo_utils import uuidutils
from cinder.openstack.common import log as logging
from cinder.openstack.common.scheduler import filters
-from cinder.openstack.common import uuidutils
from cinder.volume import api as volume
LOG = logging.getLogger(__name__)
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-
+from oslo_utils import uuidutils
from cinder.compute import nova
from cinder import exception
from cinder.i18n import _, _LW
from cinder.openstack.common import log as logging
from cinder.openstack.common.scheduler import filters
-from cinder.openstack.common import uuidutils
from cinder.volume import utils as volume_utils
"""
from oslo_utils import timeutils
+from oslo_utils import uuidutils
-from cinder.openstack.common import uuidutils
from cinder.scheduler import filter_scheduler
from cinder.scheduler import host_manager
def tearDown(self):
super(TestCinderManageCmd, self).tearDown()
- @mock.patch('cinder.openstack.common.uuidutils.is_uuid_like')
+ @mock.patch('oslo_utils.uuidutils.is_uuid_like')
def test_param2id(self, is_uuid_like):
mock_object_id = mock.MagicMock()
is_uuid_like.return_value = True
self.assertEqual(mock_object_id, object_id)
is_uuid_like.assert_called_once_with(mock_object_id)
- @mock.patch('cinder.openstack.common.uuidutils.is_uuid_like')
+ @mock.patch('oslo_utils.uuidutils.is_uuid_like')
def test_param2id_int_string(self, is_uuid_like):
object_id_str = '10'
is_uuid_like.return_value = False
import datetime
from oslo_config import cfg
+from oslo_utils import uuidutils
from cinder import context
from cinder import db
from cinder import exception
-from cinder.openstack.common import uuidutils
from cinder.quota import ReservableResource
from cinder import test
image_service, fake_image_id)
@mock.patch.object(VMDK_DRIVER, '_extend_vmdk_virtual_disk')
- @mock.patch('cinder.openstack.common.uuidutils.generate_uuid')
+ @mock.patch('oslo_utils.uuidutils.generate_uuid')
@mock.patch.object(VMDK_DRIVER, '_select_ds_for_volume')
@mock.patch.object(VMDK_DRIVER, 'volumeops')
@mock.patch.object(VMDK_DRIVER,
m.VerifyAll()
@mock.patch.object(VMDK_DRIVER, '_delete_temp_backing')
- @mock.patch('cinder.openstack.common.uuidutils.generate_uuid')
+ @mock.patch('oslo_utils.uuidutils.generate_uuid')
@mock.patch.object(VMDK_DRIVER, '_get_volume_group_folder')
@mock.patch('cinder.volume.volume_types.get_volume_type_extra_specs')
@mock.patch.object(VMDK_DRIVER, 'volumeops')
@mock.patch.object(vmware_images, 'download_stream_optimized_disk')
@mock.patch('cinder.openstack.common.fileutils.file_open')
@mock.patch.object(VMDK_DRIVER, '_temporary_file')
- @mock.patch('cinder.openstack.common.uuidutils.generate_uuid')
+ @mock.patch('oslo_utils.uuidutils.generate_uuid')
@mock.patch.object(VMDK_DRIVER, '_create_backing_in_inventory')
@mock.patch.object(VMDK_DRIVER, 'volumeops')
@mock.patch.object(VMDK_DRIVER, 'session')
@mock.patch.object(VMDK_DRIVER, '_restore_backing')
@mock.patch('cinder.openstack.common.fileutils.file_open')
@mock.patch.object(VMDK_DRIVER, '_temporary_file')
- @mock.patch('cinder.openstack.common.uuidutils.generate_uuid')
+ @mock.patch('oslo_utils.uuidutils.generate_uuid')
@mock.patch.object(VMDK_DRIVER, 'volumeops')
def test_restore_backup(self, vops, generate_uuid, temporary_file,
file_open, restore_backing, extend_volume):
@mock.patch.object(VMDK_DRIVER, '_select_ds_for_volume')
@mock.patch.object(VMDK_DRIVER,
'_create_backing_from_stream_optimized_file')
- @mock.patch('cinder.openstack.common.uuidutils.generate_uuid')
+ @mock.patch('oslo_utils.uuidutils.generate_uuid')
def test_restore_backing(
self, generate_uuid, create_backing, select_ds, get_disk_type,
vops, delete_temp_backing):
self._test_extend_vmdk_virtual_disk(volume_ops)
@mock.patch.object(VMDK_DRIVER, '_extend_vmdk_virtual_disk')
- @mock.patch('cinder.openstack.common.uuidutils.generate_uuid')
+ @mock.patch('oslo_utils.uuidutils.generate_uuid')
@mock.patch.object(VMDK_DRIVER, '_select_ds_for_volume')
@mock.patch.object(VMDK_DRIVER, 'volumeops')
@mock.patch.object(VMDK_DRIVER,
fetch_optimized_image)
@mock.patch.object(VMDK_DRIVER, '_delete_temp_backing')
- @mock.patch('cinder.openstack.common.uuidutils.generate_uuid')
+ @mock.patch('oslo_utils.uuidutils.generate_uuid')
@mock.patch.object(VMDK_DRIVER, '_get_volume_group_folder')
@mock.patch('cinder.volume.volume_types.get_volume_type_extra_specs')
@mock.patch.object(VMDK_DRIVER, 'volumeops')
@mock.patch.object(vmware_images, 'download_stream_optimized_disk')
@mock.patch('cinder.openstack.common.fileutils.file_open')
@mock.patch.object(VMDK_DRIVER, '_temporary_file')
- @mock.patch('cinder.openstack.common.uuidutils.generate_uuid')
+ @mock.patch('oslo_utils.uuidutils.generate_uuid')
@mock.patch.object(VMDK_DRIVER, '_create_backing_in_inventory')
@mock.patch.object(VMDK_DRIVER, 'volumeops')
@mock.patch.object(VMDK_DRIVER, 'session')
@mock.patch.object(VMDK_DRIVER, '_restore_backing')
@mock.patch('cinder.openstack.common.fileutils.file_open')
@mock.patch.object(VMDK_DRIVER, '_temporary_file')
- @mock.patch('cinder.openstack.common.uuidutils.generate_uuid')
+ @mock.patch('oslo_utils.uuidutils.generate_uuid')
@mock.patch.object(VMDK_DRIVER, 'volumeops')
def test_restore_backup(self, vops, generate_uuid, temporary_file,
file_open, restore_backing, extend_volume):
@mock.patch.object(VMDK_DRIVER, '_select_ds_for_volume')
@mock.patch.object(VMDK_DRIVER,
'_create_backing_from_stream_optimized_file')
- @mock.patch('cinder.openstack.common.uuidutils.generate_uuid')
+ @mock.patch('oslo_utils.uuidutils.generate_uuid')
def test_restore_backing(
self, generate_uuid, create_backing, select_ds, get_disk_type,
vops, delete_temp_backing):
from oslo_config import cfg
from oslo_utils import excutils
from oslo_utils import timeutils
+from oslo_utils import uuidutils
import six
from cinder import context
from cinder.image import glance
from cinder import keymgr
from cinder.openstack.common import log as logging
-from cinder.openstack.common import uuidutils
import cinder.policy
from cinder import quota
from cinder import quota_utils
from oslo_config import cfg
from oslo_utils import excutils
from oslo_utils import units
+from oslo_utils import uuidutils
from cinder import exception
from cinder.i18n import _, _LE, _LI, _LW
from cinder.openstack.common import fileutils
from cinder.openstack.common import log as logging
-from cinder.openstack.common import uuidutils
from cinder.volume import driver
from cinder.volume.drivers.vmware import api
from cinder.volume.drivers.vmware import datastore as hub
from oslo_utils import excutils
from oslo_utils import importutils
from oslo_utils import timeutils
+from oslo_utils import uuidutils
from osprofiler import profiler
from cinder import compute
from cinder import manager
from cinder.openstack.common import log as logging
from cinder.openstack.common import periodic_task
-from cinder.openstack.common import uuidutils
from cinder import quota
from cinder import utils
from cinder.volume.configuration import Configuration
module=scheduler.weights
module=service
module=strutils
-module=uuidutils
module=versionutils
# The base module to hold the copy of openstack.common