Rename volume/utils.py to volume/volume_utils.py

Much of our code renames this at import already --
just name it "volume_utils" for consistency, and
to make code that imports other modules named "utils"
less confusing.

Change-Id: I3cdf445ac9ab89b3b4c221ed2723835e09d48a53
This commit is contained in:
Eric Harney 2019-08-19 13:45:36 -04:00
parent bd80bc7270
commit de789648e5
152 changed files with 471 additions and 464 deletions

View File

@ -36,7 +36,7 @@ from cinder.scheduler import rpcapi as scheduler_rpcapi
from cinder import utils
from cinder import volume
from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
CONF = cfg.CONF

View File

@ -27,7 +27,7 @@ from cinder.api.schemas import snapshots as snapshot
from cinder.api import validation
from cinder.api.views import snapshots as snapshot_views
from cinder import volume
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
LOG = logging.getLogger(__name__)

View File

@ -39,7 +39,7 @@ from cinder.image import glance
from cinder import objects
from cinder import utils
from cinder import volume as cinder_volume
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
CONF = cfg.CONF

View File

@ -29,7 +29,7 @@ from cinder import objects
from cinder.objects import fields
from cinder.policies import attachments as attachment_policy
from cinder.volume import api as volume_api
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
LOG = logging.getLogger(__name__)

View File

@ -42,7 +42,7 @@ import cinder.policy
from cinder import quota
from cinder import quota_utils
import cinder.volume
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
backup_opts = [
cfg.BoolOpt('backup_use_same_host',

View File

@ -40,7 +40,7 @@ from cinder import exception
from cinder.i18n import _
from cinder import objects
from cinder.objects import fields
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
if sys.platform == 'win32':
from os_win import utilsfactory as os_win_utilsfactory

View File

@ -58,7 +58,7 @@ from cinder import quota
from cinder import rpc
from cinder import utils
from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
LOG = logging.getLogger(__name__)

View File

@ -85,7 +85,7 @@ from cinder import rpc
from cinder.scheduler import rpcapi as scheduler_rpcapi
from cinder import version
from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import utils as vutils
from cinder.volume import volume_utils as vutils
CONF = cfg.CONF

View File

@ -51,7 +51,7 @@ from cinder import objects
from cinder import rpc
from cinder import utils
from cinder import version
import cinder.volume.utils
import cinder.volume.volume_utils
CONF = cfg.CONF
@ -99,7 +99,7 @@ def _vol_notify_usage(LOG, volume_ref, extra_info, admin_context):
{'volume_id': volume_ref.id,
'project_id': volume_ref.project_id,
'extra_info': extra_info})
cinder.volume.utils.notify_about_volume_usage(
cinder.volume.volume_utils.notify_about_volume_usage(
admin_context, volume_ref, 'exists', extra_usage_info=extra_info)
except Exception as exc_msg:
LOG.error("Exists volume notification failed: %s",
@ -114,7 +114,7 @@ def _snap_notify_usage(LOG, snapshot_ref, extra_info, admin_context):
{'snapshot_id': snapshot_ref.id,
'project_id': snapshot_ref.project_id,
'extra_info': extra_info})
cinder.volume.utils.notify_about_snapshot_usage(
cinder.volume.volume_utils.notify_about_snapshot_usage(
admin_context, snapshot_ref, 'exists', extra_info)
except Exception as exc_msg:
LOG.error("Exists snapshot notification failed: %s",
@ -124,7 +124,7 @@ def _snap_notify_usage(LOG, snapshot_ref, extra_info, admin_context):
def _backup_notify_usage(LOG, backup_ref, extra_info, admin_context):
"""backup_ref notify usage"""
try:
cinder.volume.utils.notify_about_backup_usage(
cinder.volume.volume_utils.notify_about_backup_usage(
admin_context, backup_ref, 'exists', extra_info)
LOG.debug("Sent notification for <backup_id: %(backup_id)s> "
"<project_id %(project_id)s> <%(extra_info)s>",
@ -221,7 +221,7 @@ def main():
for volume_ref in volumes:
_obj_ref_action(_vol_notify_usage, LOG, volume_ref, extra_info,
admin_context, begin, end,
cinder.volume.utils.notify_about_volume_usage,
cinder.volume.volume_utils.notify_about_volume_usage,
"volume_id", "volume")
snapshots = objects.SnapshotList.get_all_active_by_window(admin_context,
@ -229,8 +229,8 @@ def main():
LOG.info("Found %d snapshots", len(snapshots))
for snapshot_ref in snapshots:
_obj_ref_action(_snap_notify_usage, LOG, snapshot_ref, extra_info,
admin_context, begin,
end, cinder.volume.utils.notify_about_snapshot_usage,
admin_context, begin, end,
cinder.volume.volume_utils.notify_about_snapshot_usage,
"snapshot_id", "snapshot")
backups = objects.BackupList.get_all_active_by_window(admin_context,
@ -239,7 +239,7 @@ def main():
LOG.info("Found %d backups", len(backups))
for backup_ref in backups:
_obj_ref_action(_backup_notify_usage, LOG, backup_ref, extra_info,
admin_context, begin,
end, cinder.volume.utils.notify_about_backup_usage,
admin_context, begin, end,
cinder.volume.volume_utils.notify_about_backup_usage,
"backup_id", "backup")
LOG.info("Volume usage audit completed")

View File

@ -66,7 +66,7 @@ from cinder.i18n import _
from cinder import objects
from cinder.objects import fields
from cinder import utils
from cinder.volume import utils as vol_utils
from cinder.volume import volume_utils as vol_utils
CONF = cfg.CONF
LOG = logging.getLogger(__name__)

View File

@ -39,8 +39,8 @@ from cinder import quota_utils
from cinder.scheduler import rpcapi as scheduler_rpcapi
from cinder.volume import api as volume_api
from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import utils as vol_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils as vol_utils
CONF = cfg.CONF

View File

@ -49,7 +49,7 @@ from cinder import exception
from cinder.i18n import _
from cinder import utils
from cinder.volume import throttling
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
LOG = logging.getLogger(__name__)

View File

@ -21,7 +21,7 @@ from cinder.i18n import _
from cinder import objects
from cinder.objects import base
from cinder.objects import fields as c_fields
from cinder.volume import utils as vol_utils
from cinder.volume import volume_utils
@base.CinderObjectRegistry.register
@ -180,8 +180,8 @@ class Group(base.CinderPersistentObject, base.CinderObject,
@property
def is_replicated(self):
if (vol_utils.is_group_a_type(self, "group_replication_enabled") or
vol_utils.is_group_a_type(
if (volume_utils.is_group_a_type(self, "group_replication_enabled") or
volume_utils.is_group_a_type(
self, "consistent_group_replication_enabled")):
return True
return False

View File

@ -21,8 +21,8 @@ from cinder import exception
from cinder.i18n import _
from cinder import objects
from cinder.objects import base
from cinder.volume import utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
@base.CinderObjectRegistry.register
@ -163,10 +163,10 @@ class VolumeType(base.CinderPersistentObject, base.CinderObject,
orm_obj, expected_attrs=expected_attrs)
def is_replicated(self):
return utils.is_replicated_spec(self.extra_specs)
return volume_utils.is_replicated_spec(self.extra_specs)
def is_multiattach(self):
return utils.is_multiattach_spec(self.extra_specs)
return volume_utils.is_multiattach_spec(self.extra_specs)
@base.CinderObjectRegistry.register

View File

@ -28,7 +28,7 @@ from cinder import exception
from cinder.i18n import _
from cinder.scheduler import driver
from cinder.scheduler import scheduler_options
from cinder.volume import utils
from cinder.volume import volume_utils as utils
CONF = cfg.CONF
LOG = logging.getLogger(__name__)

View File

@ -20,7 +20,7 @@ from cinder.compute import nova
from cinder import exception
from cinder.i18n import _
from cinder.scheduler import filters
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
LOG = logging.getLogger(__name__)

View File

@ -34,8 +34,8 @@ from cinder import exception
from cinder import objects
from cinder.scheduler import filters
from cinder import utils
from cinder.volume import utils as vol_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils as vol_utils
# FIXME: This file should be renamed to backend_manager, we should also rename

View File

@ -48,7 +48,7 @@ from cinder.objects import base as objects_base
from cinder.objects import fields
from cinder import rpc
from cinder import version
from cinder.volume import utils as vol_utils
from cinder.volume import volume_utils
if os.name == 'nt':
from os_win import utilsfactory as os_win_utilsfactory
@ -250,7 +250,7 @@ class Service(service.Service):
target = messaging.Target(
topic='%(topic)s.%(host)s' % {'topic': self.topic,
'host': self.host},
server=vol_utils.extract_host(self.host, 'host'))
server=volume_utils.extract_host(self.host, 'host'))
self.backend_rpcserver = rpc.get_server(target, endpoints,
serializer)
self.backend_rpcserver.start()
@ -262,7 +262,7 @@ class Service(service.Service):
'cluster': self.cluster})
target = messaging.Target(
topic='%s.%s' % (self.topic, self.cluster),
server=vol_utils.extract_host(self.cluster, 'host'))
server=volume_utils.extract_host(self.cluster, 'host'))
serializer = objects_base.CinderObjectSerializer(obj_version_cap)
self.cluster_rpcserver = rpc.get_server(target, endpoints,
serializer)

View File

@ -55,7 +55,7 @@ from cinder import service
from cinder.tests import fixtures as cinder_fixtures
from cinder.tests.unit import conf_fixture
from cinder.tests.unit import fake_notifier
from cinder.volume import utils
from cinder.volume import volume_utils
CONF = config.CONF
@ -540,8 +540,8 @@ class RPCAPITestCase(TestCase, ModelsObjectComparatorMixin):
version = version or self.base_version
topic = None
if server is not None:
backend = utils.extract_host(server)
server = utils.extract_host(server, 'host')
backend = volume_utils.extract_host(server)
server = volume_utils.extract_host(server, 'host')
topic = 'cinder-volume.%s' % backend
if expected_method is None:

View File

@ -21,7 +21,7 @@ from cinder.tests.unit.brick import fake_lvm
from cinder import utils
from cinder.volume import driver
from cinder.volume.drivers import lvm
from cinder.volume import utils as vol_utils
from cinder.volume import volume_utils
from cinder.zonemanager import utils as fczm_utils
@ -50,7 +50,7 @@ class FakeLoggingVolumeDriver(lvm.LVMVolumeDriver):
model_update = {}
try:
if (volume.volume_type and volume.volume_type.extra_specs and
vol_utils.is_replicated_spec(
volume_utils.is_replicated_spec(
volume.volume_type.extra_specs)):
# Sets the new volume's replication_status to disabled
model_update['replication_status'] = (

View File

@ -34,7 +34,7 @@ from cinder.tests.unit.api import fakes
from cinder.tests.unit import fake_constants as fake
from cinder.volume import api as volume_api
from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
@ddt.ddt

View File

@ -1176,9 +1176,9 @@ class GroupsAPITestCase(test.TestCase):
volume.destroy()
source_grp.destroy()
@mock.patch('cinder.volume.utils.is_replicated_spec',
@mock.patch('cinder.volume.volume_utils.is_replicated_spec',
return_value=True)
@mock.patch('cinder.volume.utils.is_group_a_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_type',
return_value=True)
def test_enable_replication(self, mock_rep_grp_type, mock_rep_vol_type):
req = fakes.HTTPRequest.blank('/v3/%s/groups/%s/action' %
@ -1199,8 +1199,8 @@ class GroupsAPITestCase(test.TestCase):
@ddt.data((True, False), (False, True), (False, False))
@ddt.unpack
@mock.patch('cinder.volume.utils.is_replicated_spec')
@mock.patch('cinder.volume.utils.is_group_a_type')
@mock.patch('cinder.volume.volume_utils.is_replicated_spec')
@mock.patch('cinder.volume.volume_utils.is_group_a_type')
def test_enable_replication_wrong_type(self, is_grp_rep_type,
is_vol_rep_type,
mock_rep_grp_type,
@ -1217,9 +1217,9 @@ class GroupsAPITestCase(test.TestCase):
self.controller.enable_replication,
req, self.group3.id, body=body)
@mock.patch('cinder.volume.utils.is_replicated_spec',
@mock.patch('cinder.volume.volume_utils.is_replicated_spec',
return_value=False)
@mock.patch('cinder.volume.utils.is_group_a_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_type',
return_value=True)
def test_enable_replication_wrong_group_type(self, mock_rep_grp_type,
mock_rep_vol_type):
@ -1233,9 +1233,9 @@ class GroupsAPITestCase(test.TestCase):
self.controller.enable_replication,
req, self.group3.id, body=body)
@mock.patch('cinder.volume.utils.is_replicated_spec',
@mock.patch('cinder.volume.volume_utils.is_replicated_spec',
return_value=True)
@mock.patch('cinder.volume.utils.is_group_a_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_type',
return_value=True)
@ddt.data((mv.GROUP_REPLICATION, True,
fields.GroupStatus.CREATING,
@ -1266,9 +1266,9 @@ class GroupsAPITestCase(test.TestCase):
self.controller.enable_replication,
req, group_id, body=body)
@mock.patch('cinder.volume.utils.is_replicated_spec',
@mock.patch('cinder.volume.volume_utils.is_replicated_spec',
return_value=True)
@mock.patch('cinder.volume.utils.is_group_a_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_type',
return_value=True)
def test_disable_replication(self, mock_rep_grp_type, mock_rep_vol_type):
req = fakes.HTTPRequest.blank('/v3/%s/groups/%s/action' %
@ -1288,9 +1288,9 @@ class GroupsAPITestCase(test.TestCase):
self.assertEqual(fields.ReplicationStatus.DISABLING,
group.replication_status)
@mock.patch('cinder.volume.utils.is_replicated_spec',
@mock.patch('cinder.volume.volume_utils.is_replicated_spec',
return_value=True)
@mock.patch('cinder.volume.utils.is_group_a_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_type',
return_value=True)
@ddt.data((mv.GROUP_REPLICATION, True,
fields.GroupStatus.CREATING,
@ -1330,9 +1330,9 @@ class GroupsAPITestCase(test.TestCase):
self.controller.disable_replication,
req, group_id, body=body)
@mock.patch('cinder.volume.utils.is_replicated_spec',
@mock.patch('cinder.volume.volume_utils.is_replicated_spec',
return_value=True)
@mock.patch('cinder.volume.utils.is_group_a_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_type',
return_value=True)
def test_failover_replication(self, mock_rep_grp_type, mock_rep_vol_type):
req = fakes.HTTPRequest.blank('/v3/%s/groups/%s/action' %
@ -1352,9 +1352,9 @@ class GroupsAPITestCase(test.TestCase):
self.assertEqual(fields.ReplicationStatus.FAILING_OVER,
group.replication_status)
@mock.patch('cinder.volume.utils.is_replicated_spec',
@mock.patch('cinder.volume.volume_utils.is_replicated_spec',
return_value=True)
@mock.patch('cinder.volume.utils.is_group_a_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_type',
return_value=True)
@ddt.data((mv.GROUP_REPLICATION, True,
fields.GroupStatus.CREATING,
@ -1394,9 +1394,9 @@ class GroupsAPITestCase(test.TestCase):
self.controller.failover_replication,
req, group_id, body=body)
@mock.patch('cinder.volume.utils.is_replicated_spec',
@mock.patch('cinder.volume.volume_utils.is_replicated_spec',
return_value=True)
@mock.patch('cinder.volume.utils.is_group_a_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_type',
return_value=True)
@mock.patch('cinder.volume.rpcapi.VolumeAPI.list_replication_targets')
def test_list_replication_targets(self, mock_list_rep_targets,

View File

@ -180,7 +180,7 @@ class GoogleBackupDriverTestCase(test.TestCase):
# Note(yikun): It mocks out the backup notifier to avoid to leak
# notifications into other test.
notify_patcher = mock.patch(
'cinder.volume.utils.notify_about_backup_usage')
'cinder.volume.volume_utils.notify_about_backup_usage')
notify_patcher.start()
self.addCleanup(notify_patcher.stop)

View File

@ -71,7 +71,7 @@ class BackupNFSShareTestCase(test.TestCase):
# Note(yikun): It mocks out the backup notifier to avoid to leak
# notifications into other test.
notify_patcher = mock.patch(
'cinder.volume.utils.notify_about_backup_usage')
'cinder.volume.volume_utils.notify_about_backup_usage')
notify_patcher.start()
self.addCleanup(notify_patcher.stop)
@ -257,7 +257,7 @@ class BackupNFSTestCase(test.TestCase):
# Note(yikun): It mocks out the backup notifier to avoid to leak
# notifications into other test.
notify_patcher = mock.patch(
'cinder.volume.utils.notify_about_backup_usage')
'cinder.volume.volume_utils.notify_about_backup_usage')
notify_patcher.start()
self.addCleanup(notify_patcher.stop)

View File

@ -126,7 +126,7 @@ class BackupSwiftTestCase(test.TestCase):
self.size_volume_file += 1024
notify_patcher = mock.patch(
'cinder.volume.utils.notify_about_backup_usage')
'cinder.volume.volume_utils.notify_about_backup_usage')
notify_patcher.start()
self.addCleanup(notify_patcher.stop)

View File

@ -1009,7 +1009,7 @@ class BackupTestCase(BaseBackupTest):
self.assertEqual('available', temp_vol['status'])
self.assertEqual('fake_provider_id', temp_vol['provider_id'])
@mock.patch('cinder.volume.utils.notify_about_backup_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_backup_usage')
def test_create_backup_with_notify(self, notify):
"""Test normal backup creation with notifications."""
vol_size = 1
@ -1021,7 +1021,7 @@ class BackupTestCase(BaseBackupTest):
self.assertEqual(2, notify.call_count)
@mock.patch('cinder.volume.rpcapi.VolumeAPI.get_backup_device')
@mock.patch('cinder.volume.utils.clone_encryption_key')
@mock.patch('cinder.volume.volume_utils.clone_encryption_key')
@mock.patch('cinder.utils.brick_get_connector_properties')
def test_create_backup_encrypted_volume(self,
mock_connector_properties,
@ -1049,7 +1049,7 @@ class BackupTestCase(BaseBackupTest):
self.assertEqual(fake.UUID2, backup.encryption_key_id)
@mock.patch('cinder.volume.rpcapi.VolumeAPI.get_backup_device')
@mock.patch('cinder.volume.utils.clone_encryption_key')
@mock.patch('cinder.volume.volume_utils.clone_encryption_key')
@mock.patch('cinder.utils.brick_get_connector_properties')
def test_create_backup_encrypted_volume_again(self,
mock_connector_properties,
@ -1262,7 +1262,7 @@ class BackupTestCase(BaseBackupTest):
backup = db.backup_get(self.ctxt, backup.id)
self.assertEqual(fields.BackupStatus.AVAILABLE, backup['status'])
@mock.patch('cinder.volume.utils.notify_about_backup_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_backup_usage')
def test_restore_backup_with_notify(self, notify):
"""Test normal backup restoration with notifications."""
vol_size = 1
@ -1275,8 +1275,8 @@ class BackupTestCase(BaseBackupTest):
self.backup_mgr.restore_backup(self.ctxt, backup, vol_id)
self.assertEqual(2, notify.call_count)
@mock.patch('cinder.volume.utils.clone_encryption_key')
@mock.patch('cinder.volume.utils.delete_encryption_key')
@mock.patch('cinder.volume.volume_utils.clone_encryption_key')
@mock.patch('cinder.volume.volume_utils.delete_encryption_key')
@mock.patch(
'cinder.tests.unit.backup.fake_service.FakeBackupService.restore')
@mock.patch('cinder.utils.brick_get_connector_properties')
@ -1308,8 +1308,8 @@ class BackupTestCase(BaseBackupTest):
mock_clone_encryption_key.assert_not_called()
mock_delete_encryption_key.assert_not_called()
@mock.patch('cinder.volume.utils.clone_encryption_key')
@mock.patch('cinder.volume.utils.delete_encryption_key')
@mock.patch('cinder.volume.volume_utils.clone_encryption_key')
@mock.patch('cinder.volume.volume_utils.delete_encryption_key')
@mock.patch(
'cinder.tests.unit.backup.fake_service.FakeBackupService.restore')
@mock.patch('cinder.utils.brick_get_connector_properties')
@ -1369,8 +1369,8 @@ class BackupTestCase(BaseBackupTest):
backup = db.backup_get(self.ctxt, backup.id)
self.assertEqual(fake.UUID2, backup.encryption_key_id)
@mock.patch('cinder.volume.utils.clone_encryption_key')
@mock.patch('cinder.volume.utils.delete_encryption_key')
@mock.patch('cinder.volume.volume_utils.clone_encryption_key')
@mock.patch('cinder.volume.volume_utils.delete_encryption_key')
@mock.patch(
'cinder.tests.unit.backup.fake_service.FakeBackupService.restore')
@mock.patch('cinder.utils.brick_get_connector_properties')
@ -1506,7 +1506,7 @@ class BackupTestCase(BaseBackupTest):
self.assertGreaterEqual(timeutils.utcnow(), backup.deleted_at)
self.assertEqual(fields.BackupStatus.DELETED, backup.status)
@mock.patch('cinder.volume.utils.delete_encryption_key')
@mock.patch('cinder.volume.volume_utils.delete_encryption_key')
def test_delete_backup_of_encrypted_volume(self,
mock_delete_encryption_key):
"""Test deletion of backup of encrypted volume"""
@ -1525,7 +1525,7 @@ class BackupTestCase(BaseBackupTest):
self.assertTrue(backup.deleted)
self.assertIsNone(backup.encryption_key_id)
@mock.patch('cinder.volume.utils.notify_about_backup_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_backup_usage')
def test_delete_backup_with_notify(self, notify):
"""Test normal backup deletion with notifications."""
vol_id = self._create_volume_db_entry(size=1)

View File

@ -415,7 +415,7 @@ class ChunkedDriverTestCase(test.TestCase):
metadata['volume-base-metadata']['display_name'])
self.assertEqual('testhost', metadata['volume-base-metadata']['host'])
@mock.patch('cinder.volume.utils.notify_about_backup_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_backup_usage')
def test_send_progress_end(self, mock_notify):
obj_meta = {}
self.driver._send_progress_end(self.ctxt, self.backup, obj_meta)
@ -423,7 +423,7 @@ class ChunkedDriverTestCase(test.TestCase):
self.assertEqual(100, obj_meta.get('backup_percent', 0))
self.assertTrue(mock_notify.called)
@mock.patch('cinder.volume.utils.notify_about_backup_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_backup_usage')
def test_send_progress_notification(self, mock_notify):
obj_meta = {}
self.driver._send_progress_notification(

View File

@ -35,7 +35,7 @@ from cinder.tests.unit import utils as tests_utils
from cinder.volume import api as volume_api
from cinder.volume import configuration as conf
from cinder.volume import driver
from cinder.volume import utils as volutils
from cinder.volume import volume_utils
GROUP_QUOTAS = quota.GROUP_QUOTAS
CONF = cfg.CONF
@ -148,7 +148,7 @@ class GroupManagerTestCase(test.TestCase):
"""Make sure that the pool is part of the host."""
self.assertIn('host', group)
host = group.host
pool = volutils.extract_host(host, level='pool')
pool = volume_utils.extract_host(host, level='pool')
self.assertEqual('fakepool', pool)
return {'status': fields.GroupStatus.AVAILABLE}

View File

@ -29,7 +29,7 @@ from cinder.tests.unit import utils as tests_utils
from cinder.volume import api as volume_api
from cinder.volume import configuration as conf
from cinder.volume import driver
from cinder.volume import utils as volutils
from cinder.volume import volume_utils
GROUP_QUOTAS = quota.GROUP_QUOTAS
CONF = cfg.CONF
@ -77,7 +77,7 @@ class GroupManagerTestCase(test.TestCase):
"""Make sure that the pool is part of the host."""
self.assertIn('host', group)
host = group.host
pool = volutils.extract_host(host, level='pool')
pool = volume_utils.extract_host(host, level='pool')
self.assertEqual('fakepool', pool)
return {'status': fields.GroupStatus.AVAILABLE,
'replication_status': fields.ReplicationStatus.DISABLING}

View File

@ -22,7 +22,7 @@ from oslo_utils import uuidutils
from cinder.scheduler import filter_scheduler
from cinder.scheduler import host_manager
from cinder.volume import utils
from cinder.volume import volume_utils as utils
UTC_NOW = timeutils.utcnow()

View File

@ -24,7 +24,7 @@ from cinder import context
from cinder.scheduler import weights
from cinder import test
from cinder.tests.unit.scheduler import fakes
from cinder.volume import utils
from cinder.volume import volume_utils as utils
class AllocatedCapacityWeigherTestCase(test.TestCase):

View File

@ -25,7 +25,7 @@ from cinder import context
from cinder.scheduler import weights
from cinder import test
from cinder.tests.unit.scheduler import fakes
from cinder.volume import utils
from cinder.volume import volume_utils as utils
@ddt.ddt

View File

@ -27,7 +27,7 @@ from cinder.scheduler import host_manager
from cinder.tests.unit import fake_constants as fake
from cinder.tests.unit.scheduler import fakes
from cinder.tests.unit.scheduler import test_scheduler
from cinder.volume import utils
from cinder.volume import volume_utils as utils
@ddt.ddt

View File

@ -25,11 +25,11 @@ from cinder.scheduler import weights
from cinder import test
from cinder.tests.unit import fake_constants
from cinder.tests.unit.scheduler import fakes
from cinder.volume import utils
from cinder.volume import volume_utils
def fake_volume_data_get_for_host(context, host, count_only=False):
host = utils.extract_host(host)
host = volume_utils.extract_host(host)
if host == 'host1':
return 1
elif host == 'host2':
@ -96,7 +96,7 @@ class VolumeNumberWeigherTestCase(test.TestCase):
weighed_host = self._get_weighed_host(backend_info_list)
self.assertEqual(0.0, weighed_host.weight)
self.assertEqual('host1',
utils.extract_host(weighed_host.obj.host))
volume_utils.extract_host(weighed_host.obj.host))
def test_volume_number_weight_multiplier2(self):
self.flags(volume_number_multiplier=1.0)
@ -113,4 +113,4 @@ class VolumeNumberWeigherTestCase(test.TestCase):
weighed_host = self._get_weighed_host(backend_info_list)
self.assertEqual(1.0, weighed_host.weight)
self.assertEqual('host5',
utils.extract_host(weighed_host.obj.host))
volume_utils.extract_host(weighed_host.obj.host))

View File

@ -16,7 +16,7 @@ from cinder import context
from cinder.tests.unit.targets import targets_fixture as tf
from cinder import utils
from cinder.volume.targets import scst
from cinder.volume import utils as vutils
from cinder.volume import volume_utils as vutils
class TestSCSTAdmDriver(tf.TargetDriverFixture):

View File

@ -23,7 +23,7 @@ from cinder import test
from cinder.tests.unit.targets import targets_fixture as tf
from cinder import utils
from cinder.volume.targets import tgt
from cinder.volume import utils as vutils
from cinder.volume import volume_utils as vutils
class TestTgtAdmDriver(tf.TargetDriverFixture):

View File

@ -1800,7 +1800,7 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase):
rpc_init.assert_called_once_with(CONF)
last_completed_audit_period.assert_called_once_with()
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
@mock.patch('cinder.objects.volume.VolumeList.get_all_active_by_window')
@mock.patch('cinder.utils.last_completed_audit_period')
@mock.patch('cinder.rpc.init')
@ -1866,7 +1866,7 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase):
extra_usage_info=local_extra_info)
])
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
@mock.patch('cinder.objects.volume.VolumeList.get_all_active_by_window')
@mock.patch('cinder.utils.last_completed_audit_period')
@mock.patch('cinder.rpc.init')
@ -1940,10 +1940,10 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase):
extra_usage_info=local_extra_info_delete)
])
@mock.patch('cinder.volume.utils.notify_about_snapshot_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_snapshot_usage')
@mock.patch('cinder.objects.snapshot.SnapshotList.'
'get_all_active_by_window')
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
@mock.patch('cinder.objects.volume.VolumeList.get_all_active_by_window')
@mock.patch('cinder.utils.last_completed_audit_period')
@mock.patch('cinder.rpc.init')
@ -2017,9 +2017,9 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase):
extra_usage_info=local_extra_info_delete)
])
@mock.patch('cinder.volume.utils.notify_about_backup_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_backup_usage')
@mock.patch('cinder.objects.backup.BackupList.get_all_active_by_window')
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
@mock.patch('cinder.objects.volume.VolumeList.get_all_active_by_window')
@mock.patch('cinder.utils.last_completed_audit_period')
@mock.patch('cinder.rpc.init')
@ -2084,12 +2084,12 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase):
ctxt, backup1, 'delete.start',
extra_usage_info=local_extra_info_delete)
@mock.patch('cinder.volume.utils.notify_about_backup_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_backup_usage')
@mock.patch('cinder.objects.backup.BackupList.get_all_active_by_window')
@mock.patch('cinder.volume.utils.notify_about_snapshot_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_snapshot_usage')
@mock.patch('cinder.objects.snapshot.SnapshotList.'
'get_all_active_by_window')
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
@mock.patch('cinder.objects.volume.VolumeList.get_all_active_by_window')
@mock.patch('cinder.utils.last_completed_audit_period')
@mock.patch('cinder.rpc.init')

View File

@ -137,7 +137,7 @@ class TestConvertImage(test.TestCase):
mock_info.return_value.virtual_size = 1048576
throttle = throttling.Throttle(prefix=['cgcmd'])
with mock.patch('cinder.volume.utils.check_for_odirect_support',
with mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=True):
output = image_utils.convert_image(source, dest, out_format,
throttle=throttle)
@ -149,7 +149,7 @@ class TestConvertImage(test.TestCase):
mock_exec.reset_mock()
with mock.patch('cinder.volume.utils.check_for_odirect_support',
with mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=False):
output = image_utils.convert_image(source, dest, out_format)
@ -170,7 +170,7 @@ class TestConvertImage(test.TestCase):
mock_info.side_effect = ValueError
throttle = throttling.Throttle(prefix=['cgcmd'])
with mock.patch('cinder.volume.utils.check_for_odirect_support',
with mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=True):
output = image_utils.convert_image(source, dest, out_format,
throttle=throttle)
@ -183,7 +183,7 @@ class TestConvertImage(test.TestCase):
mock_exec.reset_mock()
with mock.patch('cinder.volume.utils.check_for_odirect_support',
with mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=False):
output = image_utils.convert_image(source, dest, out_format)
@ -192,7 +192,7 @@ class TestConvertImage(test.TestCase):
'-O', out_format, source, dest,
run_as_root=True)
@mock.patch('cinder.volume.utils.check_for_odirect_support',
@mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=True)
@mock.patch('cinder.image.image_utils.qemu_img_info')
@mock.patch('cinder.utils.execute')
@ -217,7 +217,7 @@ class TestConvertImage(test.TestCase):
source, dest,
run_as_root=True)
@mock.patch('cinder.volume.utils.check_for_odirect_support',
@mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=True)
@mock.patch('cinder.image.image_utils.qemu_img_info')
@mock.patch('cinder.utils.execute')
@ -253,7 +253,7 @@ class TestConvertImage(test.TestCase):
out_format = mock.sentinel.out_format
mock_info.return_value.virtual_size = 1048576
with mock.patch('cinder.volume.utils.check_for_odirect_support',
with mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=True):
output = image_utils.convert_image(source, dest, out_format,
src_format='AMI')
@ -266,7 +266,7 @@ class TestConvertImage(test.TestCase):
@mock.patch('cinder.image.image_utils.qemu_img_info')
@mock.patch('cinder.utils.execute')
@mock.patch('cinder.utils.is_blk_device', return_value=False)
@mock.patch('cinder.volume.utils.check_for_odirect_support')
@mock.patch('cinder.volume.volume_utils.check_for_odirect_support')
def test_convert_to_vhd(self, mock_check_odirect, mock_isblk,
mock_exec, mock_info):
source = mock.sentinel.source
@ -307,7 +307,7 @@ class TestConvertImage(test.TestCase):
run_as_root=True)
@mock.patch('cinder.image.image_utils.CONF')
@mock.patch('cinder.volume.utils.check_for_odirect_support',
@mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=True)
@mock.patch('cinder.image.image_utils.qemu_img_info')
@mock.patch('cinder.utils.execute')

View File

@ -26,8 +26,8 @@ from cinder.volume import configuration as conf
from cinder.volume.drivers.macrosan import devop_client
from cinder.volume.drivers.macrosan import driver
from cinder.volume import qos_specs
from cinder.volume import utils as volutils
from cinder.volume import volume_types
from cinder.volume import volume_utils as volutils
test_volume = (

View File

@ -33,7 +33,7 @@ from cinder import exception
from cinder import test
from cinder.tests.unit import fake_constants as fake
from cinder import utils
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
POOL_CAPS = {'total_capacity_gb': 0,
'free_capacity_gb': 0,

View File

@ -37,7 +37,7 @@ class VolumeCleanupTestCase(base.BaseVolumeTestCase):
super(VolumeCleanupTestCase, self).setUp()
self.service_id = 1
self.mock_object(service.Service, 'service_id', self.service_id)
self.patch('cinder.volume.utils.clear_volume', autospec=True)
self.patch('cinder.volume.volume_utils.clear_volume', autospec=True)
def _assert_workers_are_removed(self):
workers = db.worker_get_all(self.context, read_deleted='yes')

View File

@ -40,7 +40,7 @@ class VolumeTransferTestCase(test.TestCase):
project_id=fake.PROJECT_ID)
self.updated_at = timeutils.utcnow()
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_transfer_volume_create_delete(self, mock_notify):
tx_api = transfer_api.API()
volume = utils.create_volume(self.ctxt, updated_at=self.updated_at)
@ -81,7 +81,7 @@ class VolumeTransferTestCase(test.TestCase):
tx_api.create,
self.ctxt, volume.id, 'Description')
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_transfer_accept_invalid_authkey(self, mock_notify):
svc = self.start_service('volume', host='test_host')
self.addCleanup(svc.stop)
@ -100,7 +100,7 @@ class VolumeTransferTestCase(test.TestCase):
tx_api.accept,
self.ctxt, transfer['id'], 'wrong')
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_transfer_accept_invalid_volume(self, mock_notify):
svc = self.start_service('volume', host='test_host')
self.addCleanup(svc.stop)
@ -130,7 +130,7 @@ class VolumeTransferTestCase(test.TestCase):
mock_notify.assert_has_calls(calls)
self.assertEqual(3, mock_notify.call_count)
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_transfer_accept_volume_in_consistencygroup(self, mock_notify):
svc = self.start_service('volume', host='test_host')
self.addCleanup(svc.stop)
@ -149,7 +149,7 @@ class VolumeTransferTestCase(test.TestCase):
@mock.patch.object(QUOTAS, "limit_check")
@mock.patch.object(QUOTAS, "reserve")
@mock.patch.object(QUOTAS, "add_volume_type_opts")
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_transfer_accept(self, mock_notify, mock_quota_voltype,
mock_quota_reserve, mock_quota_limit):
svc = self.start_service('volume', host='test_host')
@ -203,7 +203,7 @@ class VolumeTransferTestCase(test.TestCase):
@mock.patch.object(QUOTAS, "reserve")
@mock.patch.object(QUOTAS, "add_volume_type_opts")
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_transfer_accept_over_quota(self, mock_notify, mock_quota_voltype,
mock_quota_reserve):
svc = self.start_service('volume', host='test_host')
@ -236,7 +236,7 @@ class VolumeTransferTestCase(test.TestCase):
self.assertEqual(2, mock_notify.call_count)
@mock.patch.object(QUOTAS, "limit_check")
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_transfer_accept_over_quota_check_limit(self, mock_notify,
mock_quota_limit):
svc = self.start_service('volume', host='test_host')
@ -287,7 +287,7 @@ class VolumeTransferTestCase(test.TestCase):
ts = tx_api.get_all(nctxt)
self.assertEqual(0, len(ts), 'Unexpected transfers listed.')
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_delete_transfer_with_deleted_volume(self, mock_notify):
# create a volume
volume = utils.create_volume(self.ctxt, updated_at=self.updated_at)
@ -309,7 +309,7 @@ class VolumeTransferTestCase(test.TestCase):
self.ctxt,
transfer['id'])
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_transfer_accept_with_snapshots(self, mock_notify):
svc = self.start_service('volume', host='test_host')
self.addCleanup(svc.stop)
@ -350,7 +350,7 @@ class VolumeTransferTestCase(test.TestCase):
self.assertEqual(1, usages.get('volumes', {}).get('in_use', 0))
self.assertEqual(1, usages.get('snapshots', {}).get('in_use', 0))
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_transfer_accept_with_snapshots_invalid(self, mock_notify):
svc = self.start_service('volume', host='test_host')
self.addCleanup(svc.stop)
@ -364,7 +364,7 @@ class VolumeTransferTestCase(test.TestCase):
self.assertRaises(exception.InvalidSnapshot,
tx_api.create, self.ctxt, volume.id, 'Description')
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_transfer_accept_with_detail_records(self, mock_notify):
svc = self.start_service('volume', host='test_host')
self.addCleanup(svc.stop)

View File

@ -42,17 +42,17 @@ from cinder.tests.unit.image import fake as fake_image
from cinder.tests.unit import utils as test_utils
from cinder import utils
from cinder.volume import throttling
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
CONF = cfg.CONF
class NotifyUsageTestCase(test.TestCase):
@mock.patch('cinder.volume.utils._usage_from_volume')
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.utils.rpc')
@mock.patch('cinder.volume.volume_utils._usage_from_volume')
@mock.patch('cinder.volume.volume_utils.CONF')
@mock.patch('cinder.volume.volume_utils.rpc')
def test_notify_about_volume_usage(self, mock_rpc, mock_conf, mock_usage):
mock_conf.host = 'host1'
output = volume_utils.notify_about_volume_usage(mock.sentinel.context,
@ -67,9 +67,9 @@ class NotifyUsageTestCase(test.TestCase):
'volume.test_suffix',
mock_usage.return_value)
@mock.patch('cinder.volume.utils._usage_from_volume')
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.utils.rpc')
@mock.patch('cinder.volume.volume_utils._usage_from_volume')
@mock.patch('cinder.volume.volume_utils.CONF')
@mock.patch('cinder.volume.volume_utils.rpc')
def test_notify_about_volume_usage_with_kwargs(self, mock_rpc, mock_conf,
mock_usage):
mock_conf.host = 'host1'
@ -88,9 +88,9 @@ class NotifyUsageTestCase(test.TestCase):
'volume.test_suffix',
mock_usage.return_value)
@mock.patch('cinder.volume.utils._usage_from_snapshot')
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.utils.rpc')
@mock.patch('cinder.volume.volume_utils._usage_from_snapshot')
@mock.patch('cinder.volume.volume_utils.CONF')
@mock.patch('cinder.volume.volume_utils.rpc')
def test_notify_about_snapshot_usage(self, mock_rpc,
mock_conf, mock_usage):
mock_conf.host = 'host1'
@ -107,9 +107,9 @@ class NotifyUsageTestCase(test.TestCase):
'snapshot.test_suffix',
mock_usage.return_value)
@mock.patch('cinder.volume.utils._usage_from_snapshot')
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.utils.rpc')
@mock.patch('cinder.volume.volume_utils._usage_from_snapshot')
@mock.patch('cinder.volume.volume_utils.CONF')
@mock.patch('cinder.volume.volume_utils.rpc')
def test_notify_about_snapshot_usage_with_kwargs(self, mock_rpc, mock_conf,
mock_usage):
mock_conf.host = 'host1'
@ -265,9 +265,9 @@ class NotifyUsageTestCase(test.TestCase):
}
self.assertEqual(expected_volume, usage_info)
@mock.patch('cinder.volume.utils._usage_from_consistencygroup')
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.utils.rpc')
@mock.patch('cinder.volume.volume_utils._usage_from_consistencygroup')
@mock.patch('cinder.volume.volume_utils.CONF')
@mock.patch('cinder.volume.volume_utils.rpc')
def test_notify_about_consistencygroup_usage(self, mock_rpc,
mock_conf, mock_usage):
mock_conf.host = 'host1'
@ -284,9 +284,9 @@ class NotifyUsageTestCase(test.TestCase):
'consistencygroup.test_suffix',
mock_usage.return_value)
@mock.patch('cinder.volume.utils._usage_from_consistencygroup')
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.utils.rpc')
@mock.patch('cinder.volume.volume_utils._usage_from_consistencygroup')
@mock.patch('cinder.volume.volume_utils.CONF')
@mock.patch('cinder.volume.volume_utils.rpc')
def test_notify_about_consistencygroup_usage_with_kwargs(self, mock_rpc,
mock_conf,
mock_usage):
@ -307,9 +307,9 @@ class NotifyUsageTestCase(test.TestCase):
'consistencygroup.test_suffix',
mock_usage.return_value)
@mock.patch('cinder.volume.utils._usage_from_cgsnapshot')
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.utils.rpc')
@mock.patch('cinder.volume.volume_utils._usage_from_cgsnapshot')
@mock.patch('cinder.volume.volume_utils.CONF')
@mock.patch('cinder.volume.volume_utils.rpc')
def test_notify_about_cgsnapshot_usage(self, mock_rpc,
mock_conf, mock_usage):
mock_conf.host = 'host1'
@ -325,9 +325,9 @@ class NotifyUsageTestCase(test.TestCase):
'cgsnapshot.test_suffix',
mock_usage.return_value)
@mock.patch('cinder.volume.utils._usage_from_cgsnapshot')
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.utils.rpc')
@mock.patch('cinder.volume.volume_utils._usage_from_cgsnapshot')
@mock.patch('cinder.volume.volume_utils.CONF')
@mock.patch('cinder.volume.volume_utils.rpc')
def test_notify_about_cgsnapshot_usage_with_kwargs(self, mock_rpc,
mock_conf, mock_usage):
mock_conf.host = 'host1'
@ -404,9 +404,9 @@ class LVMVolumeDriverTestCase(test.TestCase):
bs = volume_utils._check_blocksize('ABM')
self.assertEqual('1M', bs)
@mock.patch('cinder.volume.utils._usage_from_capacity')
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.utils.rpc')
@mock.patch('cinder.volume.volume_utils._usage_from_capacity')
@mock.patch('cinder.volume.volume_utils.CONF')
@mock.patch('cinder.volume.volume_utils.rpc')
def test_notify_about_capacity_usage(self, mock_rpc,
mock_conf, mock_usage):
mock_conf.host = 'host1'
@ -422,9 +422,9 @@ class LVMVolumeDriverTestCase(test.TestCase):
'capacity.test_suffix',
mock_usage.return_value)
@mock.patch('cinder.volume.utils._usage_from_capacity')
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.utils.rpc')
@mock.patch('cinder.volume.volume_utils._usage_from_capacity')
@mock.patch('cinder.volume.volume_utils.CONF')
@mock.patch('cinder.volume.volume_utils.rpc')
def test_notify_about_capacity_usage_with_kwargs(self, mock_rpc, mock_conf,
mock_usage):
mock_conf.host = 'host1'
@ -518,8 +518,8 @@ class OdirectSupportTestCase(test.TestCase):
class ClearVolumeTestCase(test.TestCase):
@mock.patch('cinder.volume.utils.copy_volume', return_value=None)
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.volume_utils.copy_volume', return_value=None)
@mock.patch('cinder.volume.volume_utils.CONF')
def test_clear_volume_conf(self, mock_conf, mock_copy):
mock_conf.volume_clear = 'zero'
mock_conf.volume_clear_size = 0
@ -532,8 +532,8 @@ class ClearVolumeTestCase(test.TestCase):
execute=utils.execute, ionice='-c3',
throttle=None, sparse=False)
@mock.patch('cinder.volume.utils.copy_volume', return_value=None)
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.volume_utils.copy_volume', return_value=None)
@mock.patch('cinder.volume.volume_utils.CONF')
def test_clear_volume_args(self, mock_conf, mock_copy):
mock_conf.volume_clear = 'should_override_with_arg'
mock_conf.volume_clear_size = 0
@ -547,7 +547,7 @@ class ClearVolumeTestCase(test.TestCase):
execute=utils.execute, ionice='-c0',
throttle=None, sparse=False)
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.volume_utils.CONF')
def test_clear_volume_invalid_opt(self, mock_conf):
mock_conf.volume_clear = 'non_existent_volume_clearer'
mock_conf.volume_clear_size = 0
@ -558,10 +558,10 @@ class ClearVolumeTestCase(test.TestCase):
class CopyVolumeTestCase(test.TestCase):
@mock.patch('cinder.volume.utils.check_for_odirect_support',
@mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=True)
@mock.patch('cinder.utils.execute')
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.volume_utils.CONF')
def test_copy_volume_dd_iflag_and_oflag(self, mock_conf, mock_exec,
mock_support):
fake_throttle = throttling.Throttle(['fake_throttle'])
@ -589,7 +589,7 @@ class CopyVolumeTestCase(test.TestCase):
'bs=3M', 'iflag=count_bytes,direct',
'oflag=direct', run_as_root=True)
@mock.patch('cinder.volume.utils.check_for_odirect_support',
@mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=False)
@mock.patch('cinder.utils.execute')
def test_copy_volume_dd_no_iflag_or_oflag(self, mock_exec, mock_support):
@ -618,7 +618,7 @@ class CopyVolumeTestCase(test.TestCase):
'bs=3M', 'iflag=count_bytes',
run_as_root=True)
@mock.patch('cinder.volume.utils.check_for_odirect_support',
@mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=False)
@mock.patch('cinder.utils.execute')
def test_copy_volume_dd_no_throttle(self, mock_exec, mock_support):
@ -631,7 +631,7 @@ class CopyVolumeTestCase(test.TestCase):
'iflag=count_bytes',
'conv=fdatasync', run_as_root=True)
@mock.patch('cinder.volume.utils.check_for_odirect_support',
@mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=False)
@mock.patch('cinder.utils.execute')
def test_copy_volume_dd_with_ionice(self, mock_exec, mock_support):
@ -645,7 +645,7 @@ class CopyVolumeTestCase(test.TestCase):
'iflag=count_bytes',
'conv=fdatasync', run_as_root=True)
@mock.patch('cinder.volume.utils.check_for_odirect_support',
@mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=False)
@mock.patch('cinder.utils.execute')
def test_copy_volume_dd_with_sparse(self, mock_exec, mock_support):
@ -659,7 +659,7 @@ class CopyVolumeTestCase(test.TestCase):
'conv=fdatasync,sparse',
run_as_root=True)
@mock.patch('cinder.volume.utils.check_for_odirect_support',
@mock.patch('cinder.volume.volume_utils.check_for_odirect_support',
return_value=True)
@mock.patch('cinder.utils.execute')
def test_copy_volume_dd_with_sparse_iflag_and_oflag(self, mock_exec,
@ -674,7 +674,7 @@ class CopyVolumeTestCase(test.TestCase):
'oflag=direct', 'conv=sparse',
run_as_root=True)
@mock.patch('cinder.volume.utils._copy_volume_with_file')
@mock.patch('cinder.volume.volume_utils._copy_volume_with_file')
def test_copy_volume_handles(self, mock_copy):
handle1 = io.RawIOBase()
handle2 = io.RawIOBase()
@ -682,8 +682,8 @@ class CopyVolumeTestCase(test.TestCase):
self.assertIsNone(output)
mock_copy.assert_called_once_with(handle1, handle2, 1024)
@mock.patch('cinder.volume.utils._transfer_data')
@mock.patch('cinder.volume.utils._open_volume_with_path')
@mock.patch('cinder.volume.volume_utils._transfer_data')
@mock.patch('cinder.volume.volume_utils._open_volume_with_path')
def test_copy_volume_handle_transfer(self, mock_open, mock_transfer):
handle = io.RawIOBase()
output = volume_utils.copy_volume('/foo/bar', handle, 1024, 1)
@ -737,7 +737,7 @@ class VolumeUtilsTestCase(test.TestCase):
self.assertEqual(16, len(password))
self.assertEqual(10, len(volume_utils.generate_password(10)))
@mock.patch('cinder.volume.utils.generate_password')
@mock.patch('cinder.volume.volume_utils.generate_password')
def test_generate_username(self, mock_gen_pass):
output = volume_utils.generate_username()
self.assertEqual(mock_gen_pass.return_value, output)
@ -840,7 +840,7 @@ class VolumeUtilsTestCase(test.TestCase):
host_2 = 'fake_host2@backend1'
self.assertFalse(volume_utils.hosts_are_equivalent(host_1, host_2))
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.volume_utils.CONF')
def test_extract_id_from_volume_name_vol_id_pattern(self, conf_mock):
conf_mock.volume_name_template = 'volume-%s'
vol_id = 'd8cd1feb-2dcc-404d-9b15-b86fe3bec0a1'
@ -848,7 +848,7 @@ class VolumeUtilsTestCase(test.TestCase):
result = volume_utils.extract_id_from_volume_name(vol_name)
self.assertEqual(vol_id, result)
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.volume_utils.CONF')
def test_extract_id_from_volume_name_vol_id_vol_pattern(self, conf_mock):
conf_mock.volume_name_template = 'volume-%s-volume'
vol_id = 'd8cd1feb-2dcc-404d-9b15-b86fe3bec0a1'
@ -856,7 +856,7 @@ class VolumeUtilsTestCase(test.TestCase):
result = volume_utils.extract_id_from_volume_name(vol_name)
self.assertEqual(vol_id, result)
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.volume_utils.CONF')
def test_extract_id_from_volume_name_id_vol_pattern(self, conf_mock):
conf_mock.volume_name_template = '%s-volume'
vol_id = 'd8cd1feb-2dcc-404d-9b15-b86fe3bec0a1'
@ -864,7 +864,7 @@ class VolumeUtilsTestCase(test.TestCase):
result = volume_utils.extract_id_from_volume_name(vol_name)
self.assertEqual(vol_id, result)
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.volume_utils.CONF')
def test_extract_id_from_volume_name_no_match(self, conf_mock):
conf_mock.volume_name_template = '%s-volume'
vol_name = 'd8cd1feb-2dcc-404d-9b15-b86fe3bec0a1'
@ -894,7 +894,7 @@ class VolumeUtilsTestCase(test.TestCase):
result = volume_utils.check_already_managed_volume('not-a-uuid')
self.assertFalse(result)
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.volume_utils.CONF')
def test_extract_id_from_snapshot_name(self, conf_mock):
conf_mock.snapshot_name_template = '%s-snapshot'
snap_id = 'd8cd1feb-2dcc-404d-9b15-b86fe3bec0a1'
@ -902,7 +902,7 @@ class VolumeUtilsTestCase(test.TestCase):
result = volume_utils.extract_id_from_snapshot_name(snap_name)
self.assertEqual(snap_id, result)
@mock.patch('cinder.volume.utils.CONF')
@mock.patch('cinder.volume.volume_utils.CONF')
def test_extract_id_from_snapshot_name_no_match(self, conf_mock):
conf_mock.snapshot_name_template = '%s-snapshot'
snap_name = 'd8cd1feb-2dcc-404d-9b15-b86fe3bec0a1'

View File

@ -33,7 +33,7 @@ from cinder.volume.drivers.dell_emc.powermax import masking
from cinder.volume.drivers.dell_emc.powermax import provision
from cinder.volume.drivers.dell_emc.powermax import rest
from cinder.volume.drivers.dell_emc.powermax import utils
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
class PowerMaxCommonTest(test.TestCase):

View File

@ -23,7 +23,7 @@ from cinder.tests.unit.volume.drivers.dell_emc.powermax import (
from cinder.volume.drivers.dell_emc.powermax import common
from cinder.volume.drivers.dell_emc.powermax import fc
from cinder.volume.drivers.dell_emc.powermax import rest
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
from cinder.zonemanager import utils as fczm_utils

View File

@ -25,7 +25,7 @@ from cinder.tests.unit.volume.drivers.dell_emc.powermax import (
powermax_fake_objects as tpfo)
from cinder.volume.drivers.dell_emc.powermax import iscsi
from cinder.volume.drivers.dell_emc.powermax import rest
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
class PowerMaxISCSITest(test.TestCase):

View File

@ -27,7 +27,7 @@ from cinder.volume.drivers.dell_emc.powermax import masking
from cinder.volume.drivers.dell_emc.powermax import provision
from cinder.volume.drivers.dell_emc.powermax import rest
from cinder.volume.drivers.dell_emc.powermax import utils
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
class PowerMaxMaskingTest(test.TestCase):

View File

@ -28,7 +28,7 @@ from cinder.volume.drivers.dell_emc.powermax import iscsi
from cinder.volume.drivers.dell_emc.powermax import provision
from cinder.volume.drivers.dell_emc.powermax import rest
from cinder.volume.drivers.dell_emc.powermax import utils
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
class PowerMaxProvisionTest(test.TestCase):

View File

@ -35,7 +35,7 @@ from cinder.volume.drivers.dell_emc.powermax import masking
from cinder.volume.drivers.dell_emc.powermax import provision
from cinder.volume.drivers.dell_emc.powermax import rest
from cinder.volume.drivers.dell_emc.powermax import utils
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
class PowerMaxReplicationTest(test.TestCase):

View File

@ -29,7 +29,7 @@ from cinder.tests.unit.volume.drivers.dell_emc.powermax import (
from cinder.volume.drivers.dell_emc.powermax import fc
from cinder.volume.drivers.dell_emc.powermax import rest
from cinder.volume.drivers.dell_emc.powermax import utils
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
class PowerMaxRestTest(test.TestCase):

View File

@ -31,8 +31,8 @@ from cinder.tests.unit.volume.drivers.dell_emc.powermax import (
from cinder.volume.drivers.dell_emc.powermax import iscsi
from cinder.volume.drivers.dell_emc.powermax import rest
from cinder.volume.drivers.dell_emc.powermax import utils
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
@ddt

View File

@ -2415,7 +2415,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
@mock.patch.object(storagecenter_api.SCApi,
'create_replay_profile',
return_value=SCRPLAYPROFILE)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group(self,
mock_is_cg,
@ -2429,7 +2429,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
mock_create_replay_profile.assert_called_once_with(fake.GROUP_ID)
self.assertEqual({'status': 'available'}, model_update)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=False)
def test_create_group_not_a_cg(self,
mock_is_cg,
@ -2444,7 +2444,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
@mock.patch.object(storagecenter_api.SCApi,
'create_replay_profile',
return_value=None)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group_fail(self,
mock_is_cg,
@ -2465,7 +2465,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
return_value=SCRPLAYPROFILE)
@mock.patch.object(storagecenter_iscsi.SCISCSIDriver,
'delete_volume')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group(self,
mock_is_cg,
@ -2489,7 +2489,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
self.assertEqual(group['status'], model_update['status'])
self.assertEqual(expected_volumes, volumes)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=False)
def test_delete_group_not_a_cg(
self, mock_is_cg, mock_close_connection,
@ -2509,7 +2509,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
return_value=None)
@mock.patch.object(storagecenter_iscsi.SCISCSIDriver,
'delete_volume')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group_not_found(self,
mock_is_cg,
@ -2535,7 +2535,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
@mock.patch.object(storagecenter_api.SCApi,
'find_replay_profile',
return_value=SCRPLAYPROFILE)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_update_group(self,
mock_is_cg,
@ -2558,7 +2558,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
self.assertIsNone(rt2)
self.assertIsNone(rt3)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=False)
def test_update_group_not_a_cg(self,
mock_is_cg,
@ -2575,7 +2575,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
@mock.patch.object(storagecenter_api.SCApi,
'find_replay_profile',
return_value=None)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_update_group_not_found(self,
mock_is_cg,
@ -2601,7 +2601,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
@mock.patch.object(storagecenter_api.SCApi,
'find_replay_profile',
return_value=SCRPLAYPROFILE)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_update_group_error(self,
mock_is_cg,
@ -2631,7 +2631,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
'create_group')
@mock.patch.object(storagecenter_iscsi.SCISCSIDriver,
'create_cloned_volume')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group_from_src(
self, mock_is_cg, mock_create_cloned_volume, mock_create_group,
@ -2662,7 +2662,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
'create_group')
@mock.patch.object(storagecenter_iscsi.SCISCSIDriver,
'create_volume_from_snapshot')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group_from_src_from_snapshot(
self, mock_is_cg, mock_create_volume_from_snapshot,
@ -2699,7 +2699,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
self.driver.create_group_from_src,
context, group, volumes, None, None, None, None)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=False)
def test_create_group_from_src_not_a_cg(
self, mock_is_cg, mock_close_connection,
@ -2720,7 +2720,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
@mock.patch.object(storagecenter_api.SCApi,
'find_replay_profile',
return_value=SCRPLAYPROFILE)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group_snapshot(self,
mock_is_cg,
@ -2747,7 +2747,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
@mock.patch.object(storagecenter_api.SCApi,
'find_replay_profile',
return_value=None)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group_snapshot_profile_not_found(self,
mock_is_cg,
@ -2764,7 +2764,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
mock_find_replay_profile.assert_called_once_with(fake.GROUP_ID)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=False)
def test_create_group_snapshot_not_a_cg(
self, mock_is_cg, mock_close_connection,
@ -2781,7 +2781,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
@mock.patch.object(storagecenter_api.SCApi,
'find_replay_profile',
return_value=SCRPLAYPROFILE)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group_snapshot_fail(self,
mock_is_cg,
@ -2806,7 +2806,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
@mock.patch.object(storagecenter_api.SCApi,
'find_replay_profile',
return_value=SCRPLAYPROFILE)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group_snapshot(self,
mock_is_cg,
@ -2833,7 +2833,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
@mock.patch.object(storagecenter_api.SCApi,
'find_replay_profile',
return_value=None)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group_snapshot_profile_not_found(self,
mock_is_cg,
@ -2859,7 +2859,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
@mock.patch.object(storagecenter_api.SCApi,
'find_replay_profile',
return_value=SCRPLAYPROFILE)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group_snapshot_profile_failed_delete(
self, mock_is_cg, mock_find_replay_profile, mock_delete_cg_replay,
@ -2874,7 +2874,7 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
mock_delete_cg_replay.assert_called_once_with(self.SCRPLAYPROFILE,
fake.GROUP_SNAPSHOT_ID)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=False)
def test_delete_group_snapshot_not_a_cg(
self, mock_is_cg, mock_close_connection,

View File

@ -351,7 +351,7 @@ def patch_dd_copy(copied_lun):
@contextlib.contextmanager
def patch_copy_volume():
with mock.patch('cinder.volume.utils.copy_volume') as mocked:
with mock.patch('cinder.volume.volume_utils.copy_volume') as mocked:
yield mocked

View File

@ -144,7 +144,7 @@ class MockAdapter(object):
patch_check_cg = mock.patch(
'cinder.volume.utils.is_group_a_cg_snapshot_type',
'cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
side_effect=lambda g: not g.id.endswith('_generic'))

View File

@ -136,7 +136,8 @@ class VxFlexOSManageableCase(vxflexos.TestVxFlexOSDriver):
}
with mock.patch('cinder.volume.utils.paginate_entries_list') as mpage:
with mock.patch('cinder.volume.volume_utils.'
'paginate_entries_list') as mpage:
test_func = self.driver.get_manageable_volumes
test_func(cinder_objs, marker, limit, offset, sort_keys, sort_dirs)
mpage.assert_called_once_with(

View File

@ -110,7 +110,7 @@ class TestGroups(vxflexos.TestVxFlexOSDriver):
},
}
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group(self, is_group_a_cg_snapshot_type):
"""Test group create.
@ -126,7 +126,7 @@ class TestGroups(vxflexos.TestVxFlexOSDriver):
self.assertEqual(fields.GroupStatus.AVAILABLE,
model_update['status'])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group(self, is_group_a_cg_snapshot_type):
"""Test group deletion.
@ -145,7 +145,7 @@ class TestGroups(vxflexos.TestVxFlexOSDriver):
self.assertEqual(fields.GroupStatus.DELETED,
model_update[0]['status'])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_update_group(self, is_group_a_cg_snapshot_type):
"""Test updating a group
@ -163,7 +163,7 @@ class TestGroups(vxflexos.TestVxFlexOSDriver):
self.assertIsNone(add_up)
self.assertIsNone(remove_up)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_from_src_group(self, is_group_a_cg_snapshot_type):
"""Test creating group from source group
@ -191,7 +191,7 @@ class TestGroups(vxflexos.TestVxFlexOSDriver):
volume_provider_list = list(map(get_pid, result_volumes_model_update))
self.assertListEqual(volume_provider_list, ['sid1', 'sid2'])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_from_src_snapshot(self, is_group_a_cg_snapshot_type):
"""Test creating group from snapshot
@ -218,7 +218,7 @@ class TestGroups(vxflexos.TestVxFlexOSDriver):
volume_provider_list = list(map(get_pid, result_volumes_model_update))
self.assertListEqual(volume_provider_list, ['sid1', 'sid2'])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group_snapshot(self, is_group_a_cg_snapshot_type):
"""Test deleting group snapshot
@ -250,7 +250,7 @@ class TestGroups(vxflexos.TestVxFlexOSDriver):
self.assertTrue(all(snapshot['status'] == 'deleted' for snapshot in
result_snapshot_model_update))
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_snapshot(self, is_group_a_cg_snapshot_type):
"""Test creating group snapshot

View File

@ -25,7 +25,7 @@ from cinder.volume import configuration as config
from cinder.volume.drivers.fusionstorage import dsware
from cinder.volume.drivers.fusionstorage import fs_client
from cinder.volume.drivers.fusionstorage import fs_conf
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
class FakeDSWAREDriver(dsware.DSWAREDriver):

View File

@ -33,8 +33,8 @@ from cinder.volume.drivers.hpe import hpe_3par_common as hpecommon
from cinder.volume.drivers.hpe import hpe_3par_fc as hpefcdriver
from cinder.volume.drivers.hpe import hpe_3par_iscsi as hpedriver
from cinder.volume import qos_specs
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
hpeexceptions = hpe3parclient.hpeexceptions
@ -4899,7 +4899,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group(self, cg_ss_enable, vol_ss_enable):
cg_ss_enable.return_value = True
vol_ss_enable.return_value = True
@ -4934,7 +4934,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_with_replication_enabled(self, cg_ss_enable,
vol_ss_enable):
cg_ss_enable.return_value = True
@ -4999,7 +4999,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_empty_group_with_replication_enabled(self, cg_ss_enable,
vol_ss_enable):
cg_ss_enable.return_value = True
@ -5043,7 +5043,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group_with_replication_enabled(self, cg_ss_enable,
vol_ss_enable):
cg_ss_enable.return_value = True
@ -5099,7 +5099,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_enable_group_replication(self, cg_ss_enable, vol_ss_enable):
cg_ss_enable.return_value = True
vol_ss_enable.return_value = True
@ -5137,7 +5137,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_disable_group_replication(self, cg_ss_enable, vol_ss_enable):
cg_ss_enable.return_value = True
vol_ss_enable.return_value = True
@ -5304,7 +5304,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
@mock.patch.object(volume_types, 'get_volume_type')
def test_update_replication_enabled_group_add_vol(self, _mock_volume_types,
cg_ss_enable,
@ -5383,7 +5383,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
@mock.patch.object(volume_types, 'get_volume_type')
def test_update_repl_group_add_periodic_vol(self, _mock_volume_types,
cg_ss_enable,
@ -5469,7 +5469,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
@mock.patch.object(volume_types, 'get_volume_type')
def test_update_replication_enabled_group_remove_vol(
self, _mock_volume_types, cg_ss_enable, vol_ss_enable):
@ -5865,7 +5865,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
'get_volume_settings_from_type')
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'create_group')
@mock.patch.object(volume_types, 'get_volume_type')
@ -5977,7 +5977,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
'get_volume_settings_from_type')
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_from_src(self, cg_ss_enable, vol_ss_enable,
typ_info):
cg_ss_enable.return_value = True
@ -6081,7 +6081,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
'get_volume_settings_from_type')
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_from_src_group(self, cg_ss_enable, vol_ss_enable,
typ_info):
cg_ss_enable.return_value = True
@ -6154,7 +6154,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group(self, cg_ss_enable, vol_ss_enable):
cg_ss_enable.return_value = True
vol_ss_enable.return_value = True
@ -6206,7 +6206,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group_exceptions(self, cg_ss_enable, vol_ss_enable):
cg_ss_enable.return_value = True
vol_ss_enable.return_value = True
@ -6247,7 +6247,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_update_group_add_vol(self, cg_ss_enable, vol_ss_enable):
cg_ss_enable.return_value = True
vol_ss_enable.return_value = True
@ -6301,7 +6301,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_update_group_remove_vol(self, cg_ss_enable, vol_ss_enable):
cg_ss_enable.return_value = True
vol_ss_enable.return_value = True
@ -6372,7 +6372,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_snapshot(self, cg_ss_enable, vol_ss_enable):
cg_ss_enable.return_value = True
vol_ss_enable.return_value = True
@ -6454,7 +6454,7 @@ class TestHPE3PARDriverBase(HPE3PARBaseDriver):
@mock.patch('cinder.volume.drivers.hpe.hpe_3par_common.HPE3PARCommon.'
'is_volume_group_snap_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group_snapshot(self, cg_ss_enable, vol_ss_enable):
cg_ss_enable.return_value = True
vol_ss_enable.return_value = True
@ -9768,7 +9768,7 @@ class TestHPE3PARISCSIDriver(HPE3PARBaseDriver):
common, 'test-host', 'test-vol', 'test-host', 'fake')
mock_client.assert_has_calls(expected)
@mock.patch('cinder.volume.utils.generate_password')
@mock.patch('cinder.volume.volume_utils.generate_password')
def test_do_export(self, mock_utils):
# setup_mock_client drive with default configuration
# and return the mock HTTP 3PAR client
@ -9849,7 +9849,7 @@ class TestHPE3PARISCSIDriver(HPE3PARBaseDriver):
mock_client.assert_has_calls(expected)
self.assertEqual(expected_model, model)
@mock.patch('cinder.volume.utils.generate_password')
@mock.patch('cinder.volume.volume_utils.generate_password')
def test_do_export_host_not_found(self, mock_utils):
# setup_mock_client drive with CHAP enabled configuration
# and return the mock HTTP 3PAR client
@ -9885,7 +9885,7 @@ class TestHPE3PARISCSIDriver(HPE3PARBaseDriver):
mock_client.assert_has_calls(expected)
self.assertEqual(expected_model, model)
@mock.patch('cinder.volume.utils.generate_password')
@mock.patch('cinder.volume.volume_utils.generate_password')
def test_do_export_host_chap_disabled(self, mock_utils):
# setup_mock_client drive with CHAP enabled configuration
# and return the mock HTTP 3PAR client
@ -9931,7 +9931,7 @@ class TestHPE3PARISCSIDriver(HPE3PARBaseDriver):
mock_client.assert_has_calls(expected)
self.assertEqual(expected_model, model)
@mock.patch('cinder.volume.utils.generate_password')
@mock.patch('cinder.volume.volume_utils.generate_password')
def test_do_export_no_active_vluns(self, mock_utils):
# setup_mock_client drive with CHAP enabled configuration
# and return the mock HTTP 3PAR client
@ -9975,7 +9975,7 @@ class TestHPE3PARISCSIDriver(HPE3PARBaseDriver):
mock_client.assert_has_calls(expected)
self.assertEqual(expected_model, model)
@mock.patch('cinder.volume.utils.generate_password')
@mock.patch('cinder.volume.volume_utils.generate_password')
def test_do_export_vlun_missing_chap_credentials(self, mock_utils):
# setup_mock_client drive with CHAP enabled configuration
# and return the mock HTTP 3PAR client
@ -10032,7 +10032,7 @@ class TestHPE3PARISCSIDriver(HPE3PARBaseDriver):
mock_client.assert_has_calls(expected)
self.assertDictEqual(expected_model, model_without_remote_name)
@mock.patch('cinder.volume.utils.generate_password')
@mock.patch('cinder.volume.volume_utils.generate_password')
def test_create_export(self, mock_utils):
config = self.setup_configuration()
config.hpe3par_iscsi_chap_enabled = True

View File

@ -689,7 +689,7 @@ class TestHPELeftHandISCSIDriver(HPELeftHandBaseDriver, test.TestCase):
# validate call chain
mock_client.assert_has_calls(expected)
@mock.patch('cinder.volume.utils.generate_password')
@mock.patch('cinder.volume.volume_utils.generate_password')
def test_initialize_connection_with_chap_disabled(self, mock_utils):
# setup_mock_client drive with CHAP disabled configuration
# and return the mock HTTP LeftHand client
@ -719,7 +719,7 @@ class TestHPELeftHandISCSIDriver(HPELeftHandBaseDriver, test.TestCase):
self.connector)
mock_client.assert_has_calls(expected)
@mock.patch('cinder.volume.utils.generate_password')
@mock.patch('cinder.volume.volume_utils.generate_password')
def test_initialize_connection_with_chap_enabled(self, mock_utils):
# setup_mock_client drive with CHAP enabled configuration
# and return the mock HTTP LeftHand client
@ -2754,7 +2754,7 @@ class TestHPELeftHandISCSIDriver(HPELeftHandBaseDriver, test.TestCase):
mock_client.assert_has_calls(expected)
@mock.patch.object(volume_types, 'get_volume_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group(self, cg_ss_enabled, mock_get_volume_type):
cg_ss_enabled.side_effect = [False, True, True]
ctxt = context.get_admin_context()
@ -2794,7 +2794,7 @@ class TestHPELeftHandISCSIDriver(HPELeftHandBaseDriver, test.TestCase):
model_update['status'])
@mock.patch.object(volume_types, 'get_volume_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group(self, cg_ss_enabled, mock_get_volume_type):
cg_ss_enabled.return_value = True
ctxt = context.get_admin_context()
@ -2826,7 +2826,7 @@ class TestHPELeftHandISCSIDriver(HPELeftHandBaseDriver, test.TestCase):
model_update['status'])
@mock.patch.object(volume_types, 'get_volume_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_update_group_add_vol_delete_group(self, cg_ss_enabled,
mock_get_volume_type):
cg_ss_enabled.return_value = True
@ -2870,7 +2870,7 @@ class TestHPELeftHandISCSIDriver(HPELeftHandBaseDriver, test.TestCase):
model_update['status'])
@mock.patch.object(volume_types, 'get_volume_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_update_group_remove_vol_delete_group(self, cg_ss_enabled,
mock_get_volume_type):
cg_ss_enabled.return_value = True
@ -2917,7 +2917,7 @@ class TestHPELeftHandISCSIDriver(HPELeftHandBaseDriver, test.TestCase):
model_update['status'])
@mock.patch.object(volume_types, 'get_volume_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_groupsnapshot(self, cg_ss_enabled, mock_get_volume_type):
cg_ss_enabled.return_value = True
ctxt = context.get_admin_context()
@ -2974,7 +2974,7 @@ class TestHPELeftHandISCSIDriver(HPELeftHandBaseDriver, test.TestCase):
ctxt, groupsnapshot, expected_snaps)
@mock.patch.object(volume_types, 'get_volume_type')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_groupsnapshot(self, cg_ss_enabled, mock_get_volume_type):
cg_ss_enabled.return_value = True
ctxt = context.get_admin_context()

View File

@ -47,8 +47,8 @@ from cinder.volume.drivers.huawei import replication
from cinder.volume.drivers.huawei import rest_client
from cinder.volume.drivers.huawei import smartx
from cinder.volume import qos_specs
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
admin_contex = context.get_admin_context()

View File

@ -31,8 +31,8 @@ from cinder import test
from cinder import utils
from cinder.volume import configuration as conf
from cinder.volume.drivers.ibm import flashsystem_fc
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
class FlashSystemManagementSimulator(object):

View File

@ -51,8 +51,8 @@ from cinder.volume.drivers.ibm.storwize_svc import storwize_svc_fc
from cinder.volume.drivers.ibm.storwize_svc import storwize_svc_iscsi
from cinder.volume import group_types
from cinder.volume import qos_specs
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
SVC_POOLS = ['openstack', 'openstack1']
@ -6170,8 +6170,8 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
@mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall',
new=testutils.ZeroIntervalLoopingCall)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.utils.is_group_a_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_type')
@mock.patch.object(storwize_svc_common.StorwizeSVCCommonDriver,
'_delete_replication_grp')
def test_storwize_delete_group(self, _del_rep_grp, is_grp_a_cg_rep_type,
@ -6198,8 +6198,8 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
for volume in model_update[1]:
self.assertEqual('deleted', volume['status'])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.utils.is_group_a_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_type')
@mock.patch.object(storwize_svc_common.StorwizeSVCCommonDriver,
'_update_replication_grp')
def test_storwize_group_update(self, _update_rep_grp, is_grp_a_cg_rep_type,
@ -6224,7 +6224,7 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
@mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall',
new=testutils.ZeroIntervalLoopingCall)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_storwize_create_group_snapshot(self, is_grp_a_cg_snapshot_type):
is_grp_a_cg_snapshot_type.side_effect = [True, True, False, True]
type_ref = volume_types.create(self.ctxt, 'testtype', None)
@ -6253,7 +6253,7 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
@mock.patch('oslo_service.loopingcall.FixedIntervalLoopingCall',
new=testutils.ZeroIntervalLoopingCall)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_storwize_delete_group_snapshot(self, is_grp_a_cg_snapshot_type):
is_grp_a_cg_snapshot_type.side_effect = [True, True, True, False, True]
type_ref = volume_types.create(self.ctxt, 'testtype', None)
@ -7644,7 +7644,7 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
self.ctxt, mirror_volume, hyperswap_vol_type, diff,
host3)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_storwize_hyperswap_group_create(self, is_grp_a_cg_snapshot_type):
"""Test group create."""
is_grp_a_cg_snapshot_type.side_effect = [False, False, False, False]
@ -7683,7 +7683,7 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
self.assertEqual(fields.GroupStatus.AVAILABLE,
model_update['status'])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_storwize_hyperswap_group_delete(self, is_grp_a_cg_snapshot_type):
"""Test group create."""
is_grp_a_cg_snapshot_type.side_effect = [False, False, False]
@ -7728,7 +7728,7 @@ class StorwizeSVCCommonDriverTestCase(test.TestCase):
for volume in model_update[1]:
self.assertEqual('deleted', volume['status'])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_storwize_hyperswap_group_update(self, is_grp_a_cg_snapshot_type):
"""Test group create."""
is_grp_a_cg_snapshot_type.side_effect = [False, False, False,

View File

@ -717,7 +717,7 @@ class XIVProxyTest(test.TestCase):
pool_name = p_failback._get_backend_pool()
self.assertEqual(REPLICA_POOL, pool_name)
@mock.patch("cinder.volume.utils.is_group_a_cg_snapshot_type",
@mock.patch("cinder.volume.volume_utils.is_group_a_cg_snapshot_type",
mock.MagicMock(return_value=True))
def test_create_volume_with_consistency_group(self):
"""Test Create volume with consistency_group"""
@ -751,7 +751,7 @@ class XIVProxyTest(test.TestCase):
@mock.patch('pyxcli.mirroring.mirrored_entities.'
'MirroredEntities', mock.MagicMock())
@mock.patch('cinder.volume.utils.is_group_a_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_type',
mock.MagicMock(return_value=True))
@mock.patch("cinder.volume.drivers.ibm.ibm_storage."
"xiv_proxy.XIVProxy._get_extra_specs",
@ -2529,8 +2529,8 @@ class XIVProxyTest(test.TestCase):
# check no assertion occurs
p._silent_delete_volume(TEST_VOLUME)
@mock.patch("cinder.volume.utils.group_get_by_id", mock.MagicMock())
@mock.patch("cinder.volume.utils.is_group_a_cg_snapshot_type",
@mock.patch("cinder.volume.volume_utils.group_get_by_id", mock.MagicMock())
@mock.patch("cinder.volume.volume_utils.is_group_a_cg_snapshot_type",
mock.MagicMock(return_value=False))
def test_create_cloned_volume_calls_vol_create_and_copy(self):
"""test create_cloned_volume
@ -2567,8 +2567,8 @@ class XIVProxyTest(test.TestCase):
vol_src=vol_src['name'],
vol_trg=vol_trg['name'])
@mock.patch("cinder.volume.utils.group_get_by_id", mock.MagicMock())
@mock.patch("cinder.volume.utils.is_group_a_cg_snapshot_type",
@mock.patch("cinder.volume.volume_utils.group_get_by_id", mock.MagicMock())
@mock.patch("cinder.volume.volume_utils.is_group_a_cg_snapshot_type",
mock.MagicMock(return_value=False))
def test_handle_created_vol_properties_returns_vol_update(self):
"""test handle_created_vol_props

View File

@ -23,7 +23,7 @@ from cinder.tests.unit import utils
from cinder.tests.unit.volume.drivers.infortrend import test_infortrend_cli
from cinder.volume import configuration
from cinder.volume.drivers.infortrend.raidcmd_cli import common_cli
from cinder.volume import utils as cv_utils
from cinder.volume import volume_utils
SUCCEED = (0, '')
FAKE_ERROR_RETURN = (-1, '')
@ -2769,8 +2769,8 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCase):
result = self.driver.get_manageable_volumes(fake_cinder_volumes,
None, 1000, 0,
['reference'], ['desc'])
ans = cv_utils.paginate_entries_list(ans, None, 1000, 0,
['reference'], ['desc'])
ans = volume_utils.paginate_entries_list(ans, None, 1000, 0,
['reference'], ['desc'])
self.assertEqual(ans, result)
def test_get_manageable_snapshots(self):
@ -2830,8 +2830,8 @@ class InfortrendiSCSICommonTestCase(InfortrendTestCase):
result = self.driver.get_manageable_snapshots(fake_cinder_snapshots,
None, 1000, 0,
['reference'], ['desc'])
ans = cv_utils.paginate_entries_list(ans, None, 1000, 0,
['reference'], ['desc'])
ans = volume_utils.paginate_entries_list(ans, None, 1000, 0,
['reference'], ['desc'])
self.assertEqual(ans, result)
def test_manage_existing_snapshot(self):

View File

@ -34,7 +34,7 @@ from cinder.tests.unit import fake_snapshot
from cinder.tests.unit import fake_volume
from cinder.volume import configuration
from cinder.volume.drivers.inspur.as13000 import as13000_driver
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
CONF = cfg.CONF

View File

@ -39,8 +39,8 @@ from cinder.volume.drivers.inspur.instorage import (
from cinder.volume.drivers.inspur.instorage import instorage_common
from cinder.volume.drivers.inspur.instorage import instorage_iscsi
from cinder.volume import qos_specs
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
from cinder.tests.unit.volume.drivers.inspur.instorage import fakes

View File

@ -1055,7 +1055,7 @@ class NetAppCmodeClientTestCase(test.TestCase):
mock.call('qos-policy-group-delete-iter', api_args, False)])
self.assertEqual(1, mock_log.call_count)
@mock.patch('cinder.volume.utils.resolve_hostname',
@mock.patch('cinder.volume.volume_utils.resolve_hostname',
return_value='192.168.1.101')
def test_get_if_info_by_ip_not_found(self, mock_resolve_hostname):
fake_ip = '192.168.1.101'
@ -1070,7 +1070,7 @@ class NetAppCmodeClientTestCase(test.TestCase):
self.assertRaises(exception.NotFound, self.client.get_if_info_by_ip,
fake_ip)
@mock.patch('cinder.volume.utils.resolve_hostname',
@mock.patch('cinder.volume.volume_utils.resolve_hostname',
return_value='192.168.1.101')
def test_get_if_info_by_ip(self, mock_resolve_hostname):
fake_ip = '192.168.1.101'

View File

@ -42,7 +42,7 @@ from cinder.volume.drivers.netapp.dataontap import block_base
from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api
from cinder.volume.drivers.netapp.dataontap.utils import loopingcalls
from cinder.volume.drivers.netapp import utils as na_utils
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
@ddt.ddt

View File

@ -38,7 +38,7 @@ from cinder.volume.drivers.netapp.dataontap.utils import data_motion
from cinder.volume.drivers.netapp.dataontap.utils import loopingcalls
from cinder.volume.drivers.netapp.dataontap.utils import utils as dot_utils
from cinder.volume.drivers.netapp import utils as na_utils
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
@ddt.ddt

View File

@ -41,7 +41,7 @@ from cinder.volume.drivers.netapp.dataontap.utils import loopingcalls
from cinder.volume.drivers.netapp import utils as na_utils
from cinder.volume.drivers import nfs
from cinder.volume.drivers import remotefs
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
@ddt.ddt

View File

@ -44,7 +44,7 @@ from cinder.volume.drivers.netapp.dataontap.utils import loopingcalls
from cinder.volume.drivers.netapp.dataontap.utils import utils as dot_utils
from cinder.volume.drivers.netapp import utils as na_utils
from cinder.volume.drivers import nfs
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
@ddt.ddt

View File

@ -2129,7 +2129,7 @@ class SolidFireVolumeTestCase(test.TestCase):
get.assert_called_once_with(name)
self.assertEqual('model', result)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_cg(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = True
@ -2139,7 +2139,7 @@ class SolidFireVolumeTestCase(test.TestCase):
{'status': fields.GroupStatus.AVAILABLE})
group_cg_test.assert_called_once_with(group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group_snap_cg(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = True
@ -2154,7 +2154,7 @@ class SolidFireVolumeTestCase(test.TestCase):
_del_mock.assert_called_once_with(self.ctxt, cgsnapshot, snapshots)
self.assertEqual({}, model_update)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group_snap(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = False
@ -2169,7 +2169,7 @@ class SolidFireVolumeTestCase(test.TestCase):
self.ctxt, cgsnapshot, snapshots)
_del_mock.assert_not_called()
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_rainy(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = False
@ -2179,7 +2179,7 @@ class SolidFireVolumeTestCase(test.TestCase):
self.ctxt, group)
group_cg_test.assert_called_once_with(group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_from_src_rainy(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = False
@ -2190,7 +2190,7 @@ class SolidFireVolumeTestCase(test.TestCase):
self.ctxt, group, volumes)
group_cg_test.assert_called_once_with(group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_from_src_cg(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = True
@ -2206,7 +2206,7 @@ class SolidFireVolumeTestCase(test.TestCase):
self.assertEqual(ret, result)
group_cg_test.assert_called_once_with(group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_snapshot_rainy(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = False
@ -2219,7 +2219,7 @@ class SolidFireVolumeTestCase(test.TestCase):
snapshots)
group_cg_test.assert_called_once_with(group_snapshot)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_snapshot(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = True
@ -2235,7 +2235,7 @@ class SolidFireVolumeTestCase(test.TestCase):
self.assertEqual(ret, result)
group_cg_test.assert_called_once_with(group_snapshot)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group_rainy(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = False
@ -2248,7 +2248,7 @@ class SolidFireVolumeTestCase(test.TestCase):
volumes)
group_cg_test.assert_called_once_with(group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = True
@ -2264,7 +2264,7 @@ class SolidFireVolumeTestCase(test.TestCase):
self.assertEqual(ret, result)
group_cg_test.assert_called_once_with(group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_update_group_rainy(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = False
@ -2275,7 +2275,7 @@ class SolidFireVolumeTestCase(test.TestCase):
group)
group_cg_test.assert_called_once_with(group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_update_group(self, group_cg_test):
sfv = solidfire.SolidFireDriver(configuration=self.configuration)
group_cg_test.return_value = True

View File

@ -1737,7 +1737,7 @@ class GPFSDriverTestCase(test.TestCase):
self.assertEqual(volume_path, ret)
@mock.patch('cinder.db.get_by_id')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_local_path_volume_in_cg(self, mock_group_cg_snapshot_type,
mock_group_obj):
mock_group_cg_snapshot_type.return_value = True
@ -1856,7 +1856,7 @@ class GPFSDriverTestCase(test.TestCase):
return (volume, new_type, diff, host)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group(self, mock_cg_snapshot_type):
mock_cg_snapshot_type.return_value = False
ctxt = self.context
@ -1869,7 +1869,7 @@ class GPFSDriverTestCase(test.TestCase):
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_create_consistencygroup')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_cg(self, mock_cg_snapshot_type,
mock_consisgroup_create):
mock_cg_snapshot_type.return_value = True
@ -1878,7 +1878,7 @@ class GPFSDriverTestCase(test.TestCase):
self.driver.create_group(ctxt, group)
mock_consisgroup_create.assert_called_once_with(ctxt, group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group(self, mock_cg_snapshot_type):
mock_cg_snapshot_type.return_value = False
ctxt = self.context
@ -1892,7 +1892,7 @@ class GPFSDriverTestCase(test.TestCase):
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_delete_consistencygroup')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group_cg(self, mock_cg_snapshot_type,
mock_consisgroup_delete):
mock_cg_snapshot_type.return_value = True
@ -1902,7 +1902,7 @@ class GPFSDriverTestCase(test.TestCase):
self.driver.delete_group(ctxt, group, volumes)
mock_consisgroup_delete.assert_called_once_with(ctxt, group, volumes)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_update_group(self, mock_cg_snapshot_type):
mock_cg_snapshot_type.return_value = False
ctxt = self.context
@ -1915,7 +1915,7 @@ class GPFSDriverTestCase(test.TestCase):
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_update_consistencygroup')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_update_group_cg(self, mock_cg_snapshot_type,
mock_consisgroup_update):
mock_cg_snapshot_type.return_value = True
@ -1925,7 +1925,7 @@ class GPFSDriverTestCase(test.TestCase):
mock_consisgroup_update.assert_called_once_with(ctxt, group,
None, None)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_snapshot(self, mock_cg_snapshot_type):
mock_cg_snapshot_type.return_value = False
ctxt = self.context
@ -1939,7 +1939,7 @@ class GPFSDriverTestCase(test.TestCase):
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_create_cgsnapshot')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_snapshot_cg(self, mock_cg_snapshot_type,
mock_cgsnapshot_create):
mock_cg_snapshot_type.return_value = True
@ -1950,7 +1950,7 @@ class GPFSDriverTestCase(test.TestCase):
mock_cgsnapshot_create.assert_called_once_with(ctxt, group_snapshot,
snapshots)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group_snapshot(self, mock_cg_snapshot_type):
mock_cg_snapshot_type.return_value = False
ctxt = self.context
@ -1964,7 +1964,7 @@ class GPFSDriverTestCase(test.TestCase):
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_delete_cgsnapshot')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group_snapshot_cg(self, mock_cg_snapshot_type,
mock_cgsnapshot_delete):
mock_cg_snapshot_type.return_value = True
@ -1975,7 +1975,7 @@ class GPFSDriverTestCase(test.TestCase):
mock_cgsnapshot_delete.assert_called_once_with(ctxt, group_snapshot,
snapshots)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_from_src(self, mock_cg_snapshot_type):
mock_cg_snapshot_type.return_value = False
ctxt = self.context
@ -1989,7 +1989,7 @@ class GPFSDriverTestCase(test.TestCase):
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSDriver.'
'_create_consistencygroup_from_src')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_from_src_cg(self, mock_cg_snapshot_type,
mock_cg_clone_create):
mock_cg_snapshot_type.return_value = True
@ -2219,7 +2219,7 @@ class GPFSNFSDriverTestCase(test.TestCase):
self.assertEqual('file', stats['storage_protocol'])
@mock.patch('cinder.db.get_by_id')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_get_volume_path(self, mock_group_cg_snapshot_type, mock_group):
mock_group_cg_snapshot_type.return_value = True
self.driver.configuration.gpfs_mount_point_base = (
@ -2240,7 +2240,7 @@ class GPFSNFSDriverTestCase(test.TestCase):
self.driver._get_volume_path(volume))
@mock.patch('cinder.db.get_by_id')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.drivers.ibm.gpfs.GPFSNFSDriver.'
'_get_mount_point_for_share')
def test_local_path(self, mock_mount_point,

View File

@ -350,7 +350,7 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.create_snapshot, test_snapshot)
@mock.patch("cinder.volume.utils.copy_volume")
@mock.patch("cinder.volume.volume_utils.copy_volume")
@mock.patch("cinder.utils.brick_get_connector")
@mock.patch("cinder.utils.brick_get_connector_properties",
return_value=test_connector)
@ -379,7 +379,7 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
self.driver.create_volume_from_snapshot,
test_clone, test_snapshot)
@mock.patch("cinder.volume.utils.copy_volume")
@mock.patch("cinder.volume.volume_utils.copy_volume")
@mock.patch("cinder.utils.brick_get_connector")
@mock.patch("cinder.utils.brick_get_connector_properties",
return_value=test_connector)
@ -402,7 +402,7 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
self.assertRaises(exception.VolumeBackendAPIException,
self.driver.delete_snapshot, test_snapshot)
@mock.patch("cinder.volume.utils.copy_volume")
@mock.patch("cinder.volume.volume_utils.copy_volume")
@mock.patch("cinder.utils.brick_get_connector")
@mock.patch("cinder.utils.brick_get_connector_properties",
return_value=test_connector)
@ -433,24 +433,24 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
self.driver.create_cloned_volume,
test_clone, test_volume)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group(self, *mocks):
self.driver.create_group(None, test_group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group_metadata(self, *mocks):
self.driver.create_group(None, test_group)
self._validate_object_metadata(self._mock_group, test_group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group_twice(self, *mocks):
self.driver.create_group(None, test_group)
self.driver.create_group(None, test_group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group_api_fail(self, *mocks):
self._system.cons_groups.create.side_effect = self._raise_infinisdk
@ -458,18 +458,18 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
self.driver.create_group,
None, test_group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group(self, *mocks):
self.driver.delete_group(None, test_group, [test_volume])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group_doesnt_exist(self, *mocks):
self._system.cons_groups.safe_get.return_value = None
self.driver.delete_group(None, test_group, [test_volume])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group_api_fail(self, *mocks):
self._mock_group.safe_delete.side_effect = self._raise_infinisdk
@ -477,13 +477,13 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
self.driver.delete_group,
None, test_group, [test_volume])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_update_group_add_and_remove(self, *mocks):
self.driver.update_group(None, test_group,
[test_volume], [test_volume])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_update_group_api_fail(self, *mocks):
self._mock_group.add_member.side_effect = self._raise_infinisdk
@ -492,11 +492,11 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
None, test_group,
[test_volume], [test_volume])
@mock.patch("cinder.volume.utils.copy_volume")
@mock.patch("cinder.volume.volume_utils.copy_volume")
@mock.patch("cinder.utils.brick_get_connector")
@mock.patch("cinder.utils.brick_get_connector_properties",
return_value=test_connector)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
@mock.patch("cinder.volume.volume_types.get_volume_type_qos_specs")
def test_create_group_from_src_snaps(self, *mocks):
@ -504,11 +504,11 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
test_snapgroup, [test_snapshot],
None, None)
@mock.patch("cinder.volume.utils.copy_volume")
@mock.patch("cinder.volume.volume_utils.copy_volume")
@mock.patch("cinder.utils.brick_get_connector")
@mock.patch("cinder.utils.brick_get_connector_properties",
return_value=test_connector)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
@mock.patch("cinder.volume.volume_types.get_volume_type_qos_specs")
def test_create_group_from_src_vols(self, *mocks):
@ -516,7 +516,7 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
None, None,
test_group, [test_volume])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group_snap(self, *mocks):
mock_snapgroup = mock.Mock()
@ -528,7 +528,7 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
test_snapgroup,
[test_snapshot])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_create_group_snap_api_fail(self, *mocks):
self._mock_group.create_snapshot.side_effect = self._raise_infinisdk
@ -536,14 +536,14 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
self.driver.create_group_snapshot, None,
test_snapgroup, [test_snapshot])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group_snap(self, *mocks):
self.driver.delete_group_snapshot(None,
test_snapgroup,
[test_snapshot])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group_snap_does_not_exist(self, *mocks):
self._system.cons_groups.safe_get.return_value = None
@ -551,7 +551,7 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
test_snapgroup,
[test_snapshot])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group_snap_invalid_group(self, *mocks):
self._mock_group.is_snapgroup.return_value = False
@ -559,7 +559,7 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase):
self.driver.delete_group_snapshot,
None, test_snapgroup, [test_snapshot])
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type',
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type',
return_value=True)
def test_delete_group_snap_api_fail(self, *mocks):
self._mock_group.safe_delete.side_effect = self._raise_infinisdk

View File

@ -32,7 +32,7 @@ from cinder.volume import configuration
from cinder.volume.drivers.kaminario import kaminario_common
from cinder.volume.drivers.kaminario import kaminario_fc
from cinder.volume.drivers.kaminario import kaminario_iscsi
from cinder.volume import utils as vol_utils
from cinder.volume import volume_utils as vol_utils
CONNECTOR = {'initiator': 'iqn.1993-08.org.debian:01:12aa12aa12aa',
'ip': '192.168.2.5', 'platform': 'x86_64', 'host': 'test-k2',

View File

@ -30,8 +30,8 @@ from cinder.tests.unit import utils as tests_utils
from cinder.tests.unit.volume import test_driver
from cinder.volume import configuration as conf
from cinder.volume.drivers import lvm
import cinder.volume.utils
from cinder.volume import utils as volutils
import cinder.volume.volume_utils
from cinder.volume import volume_utils as volutils
CONF = cfg.CONF
@ -244,7 +244,7 @@ class LVMVolumeDriverTestCase(test_driver.BaseDriverTestCase):
snapshot_ref)
mock_extend.assert_called_with(dst_volume, dst_volume['size'])
@mock.patch.object(cinder.volume.utils, 'get_all_volume_groups',
@mock.patch.object(cinder.volume.volume_utils, 'get_all_volume_groups',
return_value=[{'name': 'cinder-volumes'}])
@mock.patch('cinder.brick.local_dev.lvm.LVM.update_volume_group_info')
@mock.patch('cinder.brick.local_dev.lvm.LVM.get_all_physical_volumes')
@ -266,7 +266,7 @@ class LVMVolumeDriverTestCase(test_driver.BaseDriverTestCase):
self.assertEqual('thin', lvm_driver.configuration.lvm_type)
@mock.patch.object(cinder.volume.utils, 'get_all_volume_groups',
@mock.patch.object(cinder.volume.volume_utils, 'get_all_volume_groups',
return_value=[{'name': 'cinder-volumes'}])
@mock.patch.object(cinder.brick.local_dev.lvm.LVM, 'get_volumes',
return_value=[])
@ -290,7 +290,7 @@ class LVMVolumeDriverTestCase(test_driver.BaseDriverTestCase):
self.assertEqual('thin', lvm_driver.configuration.lvm_type)
@mock.patch.object(cinder.volume.utils, 'get_all_volume_groups',
@mock.patch.object(cinder.volume.volume_utils, 'get_all_volume_groups',
return_value=[{'name': 'cinder-volumes'}])
@mock.patch('cinder.brick.local_dev.lvm.LVM.get_lv_info')
@mock.patch('cinder.brick.local_dev.lvm.LVM.activate_lv')
@ -310,7 +310,7 @@ class LVMVolumeDriverTestCase(test_driver.BaseDriverTestCase):
self.assertEqual('default', lvm_driver.configuration.lvm_type)
@mock.patch.object(cinder.volume.utils, 'get_all_volume_groups',
@mock.patch.object(cinder.volume.volume_utils, 'get_all_volume_groups',
return_value=[{'name': 'cinder-volumes'}])
@mock.patch('cinder.brick.local_dev.lvm.LVM.get_lv_info')
@mock.patch('cinder.brick.local_dev.lvm.LVM.activate_lv')

View File

@ -34,7 +34,7 @@ from cinder.tests.unit import fake_volume
from cinder.volume import configuration as conf
from cinder.volume.drivers import nfs
from cinder.volume.drivers import remotefs
from cinder.volume import utils as vutils
from cinder.volume import volume_utils
class RemoteFsDriverTestCase(test.TestCase):
@ -417,7 +417,7 @@ class NfsDriverTestCase(test.TestCase):
self.configuration.nas_mount_options = None
self.configuration.volume_dd_blocksize = '1M'
self.mock_object(vutils, 'get_max_over_subscription_ratio',
self.mock_object(volume_utils, 'get_max_over_subscription_ratio',
return_value=1)
self.context = context.get_admin_context()

View File

@ -30,7 +30,7 @@ from cinder.tests.unit import fake_group
from cinder.tests.unit import fake_group_snapshot
from cinder.tests.unit import fake_snapshot
from cinder.tests.unit import fake_volume
from cinder.volume import utils as volume_utis
from cinder.volume import volume_utils
def fake_retry(exceptions, interval=1, retries=3, backoff_rate=2):
@ -2180,7 +2180,8 @@ class PureBaseVolumeDriverTestCase(PureBaseSharedDriverTestCase):
sort_keys = mock.Mock()
sort_dirs = mock.Mock()
with mock.patch('cinder.volume.utils.paginate_entries_list') as mpage:
with mock.patch('cinder.volume.volume_utils.'
'paginate_entries_list') as mpage:
if is_snapshot:
test_func = self.driver.get_manageable_snapshots
else:
@ -3645,7 +3646,7 @@ class PureVolumeUpdateStatsTestCase(PureBaseSharedDriverTestCase):
config_ratio,
expected_ratio,
auto):
volume_utis.get_max_over_subscription_ratio = mock.Mock(
volume_utils.get_max_over_subscription_ratio = mock.Mock(
return_value=expected_ratio)
self.mock_config.pure_automatic_max_oversubscription_ratio = auto
self.mock_config.max_over_subscription_ratio = config_ratio
@ -3732,7 +3733,7 @@ class PureVolumeGroupsTestCase(PureBaseSharedDriverTestCase):
self.driver.db.group_get = mock.Mock()
@mock.patch(BASE_DRIVER_OBJ + '._add_volume_to_consistency_group')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_add_to_group_if_needed(self, mock_is_cg, mock_add_to_cg):
mock_is_cg.return_value = False
volume, vol_name = self.new_fake_vol()
@ -3746,7 +3747,7 @@ class PureVolumeGroupsTestCase(PureBaseSharedDriverTestCase):
mock_add_to_cg.assert_not_called()
@mock.patch(BASE_DRIVER_OBJ + '._add_volume_to_consistency_group')
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_add_to_group_if_needed_with_cg(self, mock_is_cg, mock_add_to_cg):
mock_is_cg.return_value = True
volume, vol_name = self.new_fake_vol()
@ -3762,7 +3763,7 @@ class PureVolumeGroupsTestCase(PureBaseSharedDriverTestCase):
vol_name
)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group(self, mock_is_cg):
mock_is_cg.return_value = False
group = fake_group.fake_group_type_obj(None)
@ -3773,7 +3774,7 @@ class PureVolumeGroupsTestCase(PureBaseSharedDriverTestCase):
)
mock_is_cg.assert_called_once_with(group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group(self, mock_is_cg):
mock_is_cg.return_value = False
group = mock.MagicMock()
@ -3785,7 +3786,7 @@ class PureVolumeGroupsTestCase(PureBaseSharedDriverTestCase):
)
mock_is_cg.assert_called_once_with(group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_update_group(self, mock_is_cg):
mock_is_cg.return_value = False
group = mock.MagicMock()
@ -3796,7 +3797,7 @@ class PureVolumeGroupsTestCase(PureBaseSharedDriverTestCase):
)
mock_is_cg.assert_called_once_with(group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_from_src(self, mock_is_cg):
mock_is_cg.return_value = False
group = mock.MagicMock()
@ -3808,7 +3809,7 @@ class PureVolumeGroupsTestCase(PureBaseSharedDriverTestCase):
)
mock_is_cg.assert_called_once_with(group)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_create_group_snapshot(self, mock_is_cg):
mock_is_cg.return_value = False
group_snapshot = mock.MagicMock()
@ -3820,7 +3821,7 @@ class PureVolumeGroupsTestCase(PureBaseSharedDriverTestCase):
)
mock_is_cg.assert_called_once_with(group_snapshot)
@mock.patch('cinder.volume.utils.is_group_a_cg_snapshot_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_cg_snapshot_type')
def test_delete_group_snapshot(self, mock_is_cg):
mock_is_cg.return_value = False
group_snapshot = mock.MagicMock()

View File

@ -44,7 +44,7 @@ from cinder.tests.unit import utils
from cinder.tests.unit.volume import test_driver
from cinder.volume import configuration as conf
import cinder.volume.drivers.rbd as driver
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
# This is used to collect raised exceptions so that tests may check what was
@ -2356,7 +2356,7 @@ class RBDTestCase(test.TestCase):
self.assertEqual((True, None), ret)
@mock.patch('tempfile.NamedTemporaryFile')
@mock.patch('cinder.volume.utils.check_encryption_provider',
@mock.patch('cinder.volume.volume_utils.check_encryption_provider',
return_value={'encryption_key_id': fake.ENCRYPTION_KEY_ID})
def test_create_encrypted_volume(self,
mock_check_enc_prov,
@ -2380,7 +2380,7 @@ class RBDTestCase(test.TestCase):
'cipher': 'aes-xts-essiv',
'key_size': 256}
with mock.patch('cinder.volume.utils.check_encryption_provider',
with mock.patch('cinder.volume.volume_utils.check_encryption_provider',
return_value=enc_info), \
mock.patch('cinder.volume.drivers.rbd.open') as mock_open, \
mock.patch.object(self.driver, '_execute') as mock_exec:

View File

@ -30,7 +30,7 @@ from cinder.tests.unit import fake_snapshot
from cinder.tests.unit import fake_volume
from cinder import utils
from cinder.volume.drivers import remotefs
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
@ddt.ddt

View File

@ -38,7 +38,7 @@ from cinder.volume.drivers.zfssa import webdavclient
from cinder.volume.drivers.zfssa import zfssaiscsi as iscsi
from cinder.volume.drivers.zfssa import zfssanfs
from cinder.volume.drivers.zfssa import zfssarest as rest
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
nfs_logbias = 'latency'

View File

@ -60,7 +60,7 @@ class CreateVolumeFlowTestCase(test.TestCase):
return_value={})
@mock.patch('cinder.objects.Volume.get_by_id')
@mock.patch('cinder.volume.utils.extract_host')
@mock.patch('cinder.volume.volume_utils.extract_host')
@mock.patch('time.time')
@mock.patch('cinder.objects.Snapshot.get_by_id')
def test_cast_create_volume_from_resource(self, mock_snapshot_get,
@ -129,7 +129,7 @@ class CreateVolumeFlowTestCase(test.TestCase):
mock_extract_host.assert_not_called()
@mock.patch('cinder.objects.Volume.get_by_id')
@mock.patch('cinder.volume.utils.extract_host')
@mock.patch('cinder.volume.volume_utils.extract_host')
@mock.patch('time.time')
@mock.patch('cinder.objects.ConsistencyGroup.get_by_id')
def test_cast_create_volume(self, consistencygroup_get_by_id, mock_time,

View File

@ -396,7 +396,7 @@ class VolumeAttachDetachTestCase(base.BaseVolumeTestCase):
def setUp(self):
super(VolumeAttachDetachTestCase, self).setUp()
self.patch('cinder.volume.utils.clear_volume', autospec=True)
self.patch('cinder.volume.volume_utils.clear_volume', autospec=True)
self.user_context = context.RequestContext(user_id=fake.USER_ID,
project_id=fake.PROJECT_ID)

View File

@ -44,7 +44,7 @@ from cinder.volume import driver
from cinder.volume import manager
from cinder.volume import rpcapi as volume_rpcapi
import cinder.volume.targets.tgt
from cinder.volume import utils as volutils
from cinder.volume import volume_utils
CONF = cfg.CONF
@ -274,7 +274,7 @@ class GenericVolumeDriverTestCase(BaseDriverTestCase):
@mock.patch.object(utils, 'brick_get_connector_properties')
@mock.patch.object(cinder.volume.manager.VolumeManager, '_attach_volume')
@mock.patch.object(cinder.volume.manager.VolumeManager, '_detach_volume')
@mock.patch.object(volutils, 'copy_volume')
@mock.patch.object(volume_utils, 'copy_volume')
@mock.patch.object(volume_rpcapi.VolumeAPI, 'get_capabilities')
@mock.patch.object(cinder.volume.volume_types,
'volume_types_encryption_changed')

View File

@ -25,8 +25,8 @@ from cinder import objects
from cinder.tests.unit import utils as tests_utils
from cinder.tests.unit import volume as base
from cinder.volume import driver
from cinder.volume import utils as volutils
from cinder.volume import volume_migration as volume_migration
from cinder.volume import volume_utils as volutils
CONF = cfg.CONF

View File

@ -25,7 +25,7 @@ from cinder.tests.unit import utils as tests_utils
from cinder.tests.unit import volume as base
from cinder.volume.flows.manager import manage_existing
from cinder.volume import manager
from cinder.volume import utils
from cinder.volume import volume_utils
FAKE_HOST_POOL = 'volPool'
FAKE_HOST = 'hostname@backend'
@ -160,7 +160,8 @@ class ManageVolumeTestCase(base.BaseVolumeTestCase):
self.manager._update_stats_for_managed(volume_obj)
mock_safe_get.assert_called_once_with('volume_backend_name')
backend_stats = self.manager.stats['pools'][utils.DEFAULT_POOL_NAME]
pool_stats = self.manager.stats['pools']
backend_stats = pool_stats[volume_utils.DEFAULT_POOL_NAME]
self.assertEqual(1, backend_stats['allocated_capacity_gb'])
def test_update_stats_key_error(self):
@ -174,7 +175,7 @@ class ManageVolumeTestCase(base.BaseVolumeTestCase):
'manage_existing')
@mock.patch('cinder.volume.drivers.lvm.LVMVolumeDriver.'
'manage_existing_get_size')
@mock.patch('cinder.volume.utils.notify_about_volume_usage')
@mock.patch('cinder.volume.volume_utils.notify_about_volume_usage')
def test_manage_volume_with_notify(self, mock_notify, mock_size,
mock_manage):
elevated = context.get_admin_context()

View File

@ -33,7 +33,7 @@ from cinder.tests.unit import volume as base
import cinder.volume
from cinder.volume import manager
from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import utils as vol_utils
from cinder.volume import volume_utils
CONF = cfg.CONF
@ -462,7 +462,7 @@ class ReplicationTestCase(base.BaseVolumeTestCase):
in_groups=None, out_groups=None,
driver_group_result=None,
secondary_id=None):
host = vol_utils.extract_host(self.manager.host)
host = volume_utils.extract_host(self.manager.host)
utils.create_service(self.context, {'host': host,
'binary': constants.VOLUME_BINARY})
for volume in in_volumes:
@ -487,7 +487,7 @@ class ReplicationTestCase(base.BaseVolumeTestCase):
self._check_failover_db(objects.SnapshotList, out_snapshots)
self._check_failover_db(objects.GroupList, out_groups)
@mock.patch('cinder.volume.utils.is_group_a_type')
@mock.patch('cinder.volume.volume_utils.is_group_a_type')
def test_failover_host_model_updates(self, mock_group_type):
status = fields.ReplicationStatus
mock_group_type.return_value = True

View File

@ -92,7 +92,7 @@ class VolumeTestCase(base.BaseVolumeTestCase):
def setUp(self):
super(VolumeTestCase, self).setUp()
self.patch('cinder.volume.utils.clear_volume', autospec=True)
self.patch('cinder.volume.volume_utils.clear_volume', autospec=True)
self.expected_status = 'available'
self.service_id = 1
self.user_context = context.RequestContext(user_id=fake.USER_ID,

View File

@ -40,8 +40,8 @@ import cinder.volume
from cinder.volume import api as volume_api
from cinder.volume.flows.manager import create_volume as create_volume_manager
from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import utils as volutils
from cinder.volume import volume_types
from cinder.volume import volume_utils as volutils
QUOTAS = quota.QUOTAS
@ -72,8 +72,9 @@ class VolumeMigrationTestCase(base.BaseVolumeTestCase):
def setUp(self):
super(VolumeMigrationTestCase, self).setUp()
self._clear_patch = mock.patch('cinder.volume.utils.clear_volume',
autospec=True)
self._clear_patch = mock.patch(
'cinder.volume.volume_utils.clear_volume',
autospec=True)
self._clear_patch.start()
self.expected_status = 'available'
self._service = tests_utils.create_service(

View File

@ -35,7 +35,7 @@ class VolumeRetypeTestCase(base.BaseVolumeTestCase):
def setUp(self):
super(VolumeRetypeTestCase, self).setUp()
self.patch('cinder.volume.utils.clear_volume', autospec=True)
self.patch('cinder.volume.volume_utils.clear_volume', autospec=True)
self.expected_status = 'available'
self.service_id = 1
self.user_context = context.RequestContext(user_id=fake.USER_ID,

View File

@ -260,8 +260,8 @@ class TestWindowsISCSIDriver(test.TestCase):
self.assertEqual(expected_target_name, target_name)
@mock.patch.object(windows_iscsi.WindowsISCSIDriver, '_get_target_name')
@mock.patch.object(windows_iscsi.utils, 'generate_username')
@mock.patch.object(windows_iscsi.utils, 'generate_password')
@mock.patch.object(windows_iscsi.volume_utils, 'generate_username')
@mock.patch.object(windows_iscsi.volume_utils, 'generate_password')
def test_create_export(self, mock_generate_password,
mock_generate_username,
mock_get_target_name):

View File

@ -35,7 +35,7 @@ from cinder.policies import volume_transfer as policy
from cinder import quota
from cinder import quota_utils
from cinder.volume import api as volume_api
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
volume_transfer_opts = [

View File

@ -61,8 +61,8 @@ from cinder import utils
from cinder.volume.flows.api import create_volume
from cinder.volume.flows.api import manage_existing
from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
allow_force_upload_opt = cfg.BoolOpt('enable_force_upload',
default=False,

View File

@ -26,7 +26,7 @@ from oslo_utils import units
from cinder import exception
from cinder.i18n import _
from cinder.volume import utils as volutils
from cinder.volume import volume_utils
import cinder.volume.drivers.datera.datera_common as datc
@ -579,7 +579,7 @@ class DateraApi(object):
'cinder_id': cinder_id,
'extra_info': extra_info})
page_results = volutils.paginate_entries_list(
page_results = volume_utils.paginate_entries_list(
results, marker, limit, offset, sort_keys, sort_dirs)
return page_results

View File

@ -27,7 +27,7 @@ from oslo_utils import units
from cinder import exception
from cinder.i18n import _
from cinder.volume import utils as volutils
from cinder.volume import volume_utils
import cinder.volume.drivers.datera.datera_common as datc
@ -701,7 +701,7 @@ class DateraApi(object):
'cinder_id': cinder_id,
'extra_info': extra_info})
page_results = volutils.paginate_entries_list(
page_results = volume_utils.paginate_entries_list(
results, marker, limit, offset, sort_keys, sort_dirs)
return page_results

View File

@ -37,8 +37,8 @@ from cinder.volume.drivers.dell_emc.powermax import metadata as volume_metadata
from cinder.volume.drivers.dell_emc.powermax import provision
from cinder.volume.drivers.dell_emc.powermax import rest
from cinder.volume.drivers.dell_emc.powermax import utils
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
LOG = logging.getLogger(__name__)
CONF = cfg.CONF

View File

@ -27,7 +27,7 @@ from cinder import exception
from cinder.i18n import _
from cinder.volume.drivers.dell_emc.powermax import provision
from cinder.volume.drivers.dell_emc.powermax import utils
from cinder.volume import utils as volume_utils
from cinder.volume import volume_utils
LOG = logging.getLogger(__name__)

View File

@ -27,8 +27,8 @@ import six
from cinder import exception
from cinder.i18n import _
from cinder.objects import fields
from cinder.volume import utils as vol_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils as vol_utils
LOG = logging.getLogger(__name__)

View File

@ -26,8 +26,8 @@ from cinder.volume import configuration
from cinder.volume import driver
from cinder.volume.drivers.dell_emc.sc import storagecenter_api
from cinder.volume.drivers.san.san import san_opts
from cinder.volume import utils as volume_utils
from cinder.volume import volume_types
from cinder.volume import volume_utils
common_opts = [
cfg.IntOpt('dell_sc_ssn',

View File

@ -30,7 +30,7 @@ from cinder.objects import fields
from cinder import utils as cinder_utils
from cinder.volume.drivers.dell_emc.unity import client
from cinder.volume.drivers.dell_emc.unity import utils
from cinder.volume import utils as vol_utils
from cinder.volume import volume_utils as vol_utils
storops = importutils.try_import('storops')
if storops:

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