Merge "Small performance improvement"
This commit is contained in:
commit
3d8479f7a1
@ -47,6 +47,9 @@ from openstack_dashboard.usage import quotas
|
||||
INDEX_URL = reverse('horizon:project:instances:index')
|
||||
SEC_GROUP_ROLE_PREFIX = \
|
||||
workflows.update_instance.INSTANCE_SEC_GROUP_SLUG + "_role_"
|
||||
AVAILABLE = api.cinder.VOLUME_STATE_AVAILABLE
|
||||
VOLUME_SEARCH_OPTS = dict(status=AVAILABLE, bootable=1)
|
||||
SNAPSHOT_SEARCH_OPTS = dict(status=AVAILABLE)
|
||||
|
||||
|
||||
class InstanceTests(helpers.TestCase):
|
||||
@ -1360,10 +1363,12 @@ class InstanceTests(helpers.TestCase):
|
||||
api.nova.extension_supported('BlockDeviceMappingV2Boot',
|
||||
IsA(http.HttpRequest)) \
|
||||
.AndReturn(block_device_mapping_v2)
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
api.glance.image_list_detailed(
|
||||
IsA(http.HttpRequest),
|
||||
filters={'is_public': True, 'status': 'active'}) \
|
||||
@ -1569,10 +1574,14 @@ class InstanceTests(helpers.TestCase):
|
||||
api.nova.extension_supported('BlockDeviceMappingV2Boot',
|
||||
IsA(http.HttpRequest)) \
|
||||
.AndReturn(block_device_mapping_v2)
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
volumes = [v for v in self.volumes.list()
|
||||
if (v.status == AVAILABLE and v.bootable == 'true')]
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn(volumes)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
api.glance.image_list_detailed(
|
||||
IsA(http.HttpRequest),
|
||||
filters={'is_public': True, 'status': 'active'}) \
|
||||
@ -1714,9 +1723,12 @@ class InstanceTests(helpers.TestCase):
|
||||
.AndReturn(disk_config)
|
||||
api.nova.extension_supported(
|
||||
'ConfigDrive', IsA(http.HttpRequest)).AndReturn(config_drive)
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).AndReturn([])
|
||||
if disk_config:
|
||||
disk_config_value = u'AUTO'
|
||||
else:
|
||||
@ -1858,9 +1870,14 @@ class InstanceTests(helpers.TestCase):
|
||||
.AndReturn(True)
|
||||
api.nova.extension_supported('ConfigDrive',
|
||||
IsA(http.HttpRequest)).AndReturn(True)
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).AndReturn([])
|
||||
volumes = [v for v in self.volumes.list()
|
||||
if (v.status == AVAILABLE and v.bootable == 'true')]
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn(volumes)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
api.nova.server_create(IsA(http.HttpRequest),
|
||||
server.name,
|
||||
'',
|
||||
@ -1989,9 +2006,14 @@ class InstanceTests(helpers.TestCase):
|
||||
.AndReturn(True)
|
||||
api.nova.extension_supported('ConfigDrive',
|
||||
IsA(http.HttpRequest)).AndReturn(True)
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).AndReturn([])
|
||||
volumes = [v for v in self.volumes.list()
|
||||
if (v.status == AVAILABLE and v.bootable == 'true')]
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn(volumes)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
quotas.tenant_quota_usages(IsA(http.HttpRequest)) \
|
||||
.AndReturn(quota_usages)
|
||||
|
||||
@ -2109,9 +2131,12 @@ class InstanceTests(helpers.TestCase):
|
||||
.AndReturn(self.security_groups.list())
|
||||
api.nova.availability_zone_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.availability_zones.list())
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).AndReturn([])
|
||||
quotas.tenant_quota_usages(IsA(http.HttpRequest)) \
|
||||
.AndReturn(quota_usages)
|
||||
|
||||
@ -2201,9 +2226,11 @@ class InstanceTests(helpers.TestCase):
|
||||
api.nova.extension_supported('ConfigDrive',
|
||||
IsA(http.HttpRequest)).AndReturn(True)
|
||||
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).AndReturn([])
|
||||
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
|
||||
quotas.tenant_quota_usages(IsA(http.HttpRequest)) \
|
||||
@ -2250,10 +2277,12 @@ class InstanceTests(helpers.TestCase):
|
||||
api.nova.extension_supported('BlockDeviceMappingV2Boot',
|
||||
IsA(http.HttpRequest)) \
|
||||
.AndReturn(True)
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
api.glance.image_list_detailed(
|
||||
IsA(http.HttpRequest),
|
||||
filters={'is_public': True, 'status': 'active'}) \
|
||||
@ -2332,8 +2361,16 @@ class InstanceTests(helpers.TestCase):
|
||||
api.nova.extension_supported('BlockDeviceMappingV2Boot',
|
||||
IsA(http.HttpRequest)) \
|
||||
.AndReturn(True)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
volumes = [v for v in self.volumes.list()
|
||||
if (v.status == AVAILABLE and v.bootable == 'true')]
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn(volumes)
|
||||
volumes = [v for v in self.volumes.list()
|
||||
if (v.status == AVAILABLE)]
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn(volumes)
|
||||
api.nova.flavor_list(IgnoreArg()).AndReturn(self.flavors.list())
|
||||
api.nova.keypair_list(IgnoreArg()).AndReturn(self.keypairs.list())
|
||||
api.network.security_group_list(IsA(http.HttpRequest)) \
|
||||
@ -2373,7 +2410,6 @@ class InstanceTests(helpers.TestCase):
|
||||
.AndReturn(True)
|
||||
api.nova.extension_supported('ConfigDrive',
|
||||
IsA(http.HttpRequest)).AndReturn(True)
|
||||
cinder.volume_list(IgnoreArg()).AndReturn(self.volumes.list())
|
||||
api.nova.server_create(IsA(http.HttpRequest),
|
||||
server.name,
|
||||
image.id,
|
||||
@ -2491,9 +2527,14 @@ class InstanceTests(helpers.TestCase):
|
||||
.AndReturn(True)
|
||||
api.nova.extension_supported('ConfigDrive',
|
||||
IsA(http.HttpRequest)).AndReturn(True)
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).AndReturn([])
|
||||
volumes = [v for v in self.volumes.list()
|
||||
if (v.status == AVAILABLE and v.bootable == 'true')]
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn(volumes)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
|
||||
api.nova.flavor_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.flavors.list())
|
||||
@ -2593,9 +2634,14 @@ class InstanceTests(helpers.TestCase):
|
||||
.AndReturn(True)
|
||||
api.nova.extension_supported('ConfigDrive',
|
||||
IsA(http.HttpRequest)).AndReturn(True)
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).AndReturn([])
|
||||
volumes = [v for v in self.volumes.list()
|
||||
if (v.status == AVAILABLE and v.bootable == 'true')]
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn(volumes)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
|
||||
api.nova.flavor_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.flavors.list())
|
||||
@ -2712,9 +2758,14 @@ class InstanceTests(helpers.TestCase):
|
||||
.AndReturn(True)
|
||||
api.nova.extension_supported('ConfigDrive',
|
||||
IsA(http.HttpRequest)).AndReturn(True)
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).AndReturn([])
|
||||
volumes = [v for v in self.volumes.list()
|
||||
if (v.status == AVAILABLE and v.bootable == 'true')]
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn(volumes)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
|
||||
api.nova.flavor_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.flavors.list())
|
||||
@ -2838,9 +2889,14 @@ class InstanceTests(helpers.TestCase):
|
||||
'DiskConfig', IsA(http.HttpRequest)).AndReturn(True)
|
||||
api.nova.extension_supported(
|
||||
'ConfigDrive', IsA(http.HttpRequest)).AndReturn(True)
|
||||
cinder.volume_list(
|
||||
IsA(http.HttpRequest)).AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).AndReturn([])
|
||||
volumes = [v for v in self.volumes.list()
|
||||
if (v.status == AVAILABLE and v.bootable == 'true')]
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn(volumes)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
api.nova.flavor_list(
|
||||
IsA(http.HttpRequest)).AndReturn(self.flavors.list())
|
||||
api.nova.tenant_absolute_limits(
|
||||
@ -2956,9 +3012,14 @@ class InstanceTests(helpers.TestCase):
|
||||
.AndReturn(True)
|
||||
api.nova.extension_supported('ConfigDrive',
|
||||
IsA(http.HttpRequest)).AndReturn(True)
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).AndReturn([])
|
||||
volumes = [v for v in self.volumes.list()
|
||||
if (v.status == AVAILABLE and v.bootable == 'true')]
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn(volumes)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
|
||||
api.nova.flavor_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.flavors.list())
|
||||
@ -3135,9 +3196,14 @@ class InstanceTests(helpers.TestCase):
|
||||
.AndReturn(True)
|
||||
api.nova.extension_supported('ConfigDrive',
|
||||
IsA(http.HttpRequest)).AndReturn(True)
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).AndReturn([])
|
||||
volumes = [v for v in self.volumes.list()
|
||||
if (v.status == AVAILABLE and v.bootable == 'true')]
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn(volumes)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
|
||||
api.nova.flavor_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.flavors.list())
|
||||
@ -3235,10 +3301,12 @@ class InstanceTests(helpers.TestCase):
|
||||
test_with_profile=False):
|
||||
keypair = self.keypairs.first()
|
||||
|
||||
cinder.volume_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)) \
|
||||
.AndReturn(self.volumes.list())
|
||||
cinder.volume_list(IsA(http.HttpRequest),
|
||||
search_opts=VOLUME_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SNAPSHOT_SEARCH_OPTS) \
|
||||
.AndReturn([])
|
||||
api.glance.image_list_detailed(
|
||||
IsA(http.HttpRequest),
|
||||
filters={'is_public': True, 'status': 'active'}) \
|
||||
|
@ -457,10 +457,10 @@ class SetInstanceDetailsAction(workflows.Action):
|
||||
volumes = []
|
||||
try:
|
||||
if base.is_service_enabled(request, 'volume'):
|
||||
available = api.cinder.VOLUME_STATE_AVAILABLE
|
||||
volumes = [self._get_volume_display_name(v)
|
||||
for v in cinder.volume_list(self.request)
|
||||
if (v.status == api.cinder.VOLUME_STATE_AVAILABLE
|
||||
and v.bootable == 'true')]
|
||||
for v in cinder.volume_list(self.request,
|
||||
search_opts=dict(status=available, bootable=1))]
|
||||
except Exception:
|
||||
exceptions.handle(self.request,
|
||||
_('Unable to retrieve list of volumes.'))
|
||||
@ -474,9 +474,10 @@ class SetInstanceDetailsAction(workflows.Action):
|
||||
snapshots = []
|
||||
try:
|
||||
if base.is_service_enabled(request, 'volume'):
|
||||
snaps = cinder.volume_snapshot_list(self.request)
|
||||
snapshots = [self._get_volume_display_name(s) for s in snaps
|
||||
if s.status == api.cinder.VOLUME_STATE_AVAILABLE]
|
||||
available = api.cinder.VOLUME_STATE_AVAILABLE
|
||||
snapshots = [self._get_volume_display_name(s)
|
||||
for s in cinder.volume_snapshot_list(
|
||||
self.request, search_opts=dict(status=available))]
|
||||
except Exception:
|
||||
exceptions.handle(self.request,
|
||||
_('Unable to retrieve list of volume '
|
||||
|
@ -184,9 +184,9 @@ class CreateForm(forms.SelfHandlingForm):
|
||||
self.availability_zones(request)
|
||||
|
||||
try:
|
||||
snapshot_list = cinder.volume_snapshot_list(request)
|
||||
snapshots = [s for s in snapshot_list
|
||||
if s.status == 'available']
|
||||
available = api.cinder.VOLUME_STATE_AVAILABLE
|
||||
snapshots = cinder.volume_snapshot_list(
|
||||
request, search_opts=dict(status=available))
|
||||
if snapshots:
|
||||
source_type_choices.append(("snapshot_source",
|
||||
_("Snapshot")))
|
||||
@ -294,10 +294,9 @@ class CreateForm(forms.SelfHandlingForm):
|
||||
def get_volumes(self, request):
|
||||
volumes = []
|
||||
try:
|
||||
volume_list = cinder.volume_list(self.request)
|
||||
if volume_list is not None:
|
||||
volumes = [v for v in volume_list
|
||||
if v.status == api.cinder.VOLUME_STATE_AVAILABLE]
|
||||
available = api.cinder.VOLUME_STATE_AVAILABLE
|
||||
volumes = cinder.volume_list(self.request,
|
||||
search_opts=dict(status=available))
|
||||
except Exception:
|
||||
exceptions.handle(request,
|
||||
_('Unable to retrieve list of volumes.'))
|
||||
|
@ -34,6 +34,7 @@ from openstack_dashboard.usage import quotas
|
||||
|
||||
VOLUME_INDEX_URL = reverse('horizon:project:volumes:index')
|
||||
VOLUME_VOLUMES_TAB_URL = reverse('horizon:project:volumes:volumes_tab')
|
||||
SEARCH_OPTS = dict(status=api.cinder.VOLUME_STATE_AVAILABLE)
|
||||
|
||||
|
||||
class VolumeViewTests(test.TestCase):
|
||||
@ -65,7 +66,8 @@ class VolumeViewTests(test.TestCase):
|
||||
AndReturn(self.volume_types.list())
|
||||
quotas.tenant_limit_usages(IsA(http.HttpRequest)).\
|
||||
AndReturn(usage_limit)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).\
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).\
|
||||
AndReturn(self.cinder_volume_snapshots.list())
|
||||
api.glance.image_list_detailed(
|
||||
IsA(http.HttpRequest),
|
||||
@ -82,7 +84,8 @@ class VolumeViewTests(test.TestCase):
|
||||
cinder.extension_supported(IsA(http.HttpRequest), 'AvailabilityZones')\
|
||||
.AndReturn(True)
|
||||
cinder.volume_list(IsA(
|
||||
http.HttpRequest)).AndReturn(self.cinder_volumes.list())
|
||||
http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).AndReturn(self.cinder_volumes.list())
|
||||
|
||||
cinder.volume_create(IsA(http.HttpRequest),
|
||||
formData['size'],
|
||||
@ -132,7 +135,8 @@ class VolumeViewTests(test.TestCase):
|
||||
AndReturn(self.volume_types.list())
|
||||
quotas.tenant_limit_usages(IsA(http.HttpRequest)).\
|
||||
AndReturn(usage_limit)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).\
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).\
|
||||
AndReturn(self.cinder_volume_snapshots.list())
|
||||
api.glance.image_list_detailed(
|
||||
IsA(http.HttpRequest),
|
||||
@ -149,7 +153,8 @@ class VolumeViewTests(test.TestCase):
|
||||
cinder.extension_supported(IsA(http.HttpRequest), 'AvailabilityZones')\
|
||||
.AndReturn(True)
|
||||
cinder.volume_list(IsA(
|
||||
http.HttpRequest)).AndReturn(self.cinder_volumes.list())
|
||||
http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).AndReturn(self.cinder_volumes.list())
|
||||
|
||||
cinder.volume_create(IsA(http.HttpRequest),
|
||||
formData['size'],
|
||||
@ -196,7 +201,8 @@ class VolumeViewTests(test.TestCase):
|
||||
|
||||
cinder.volume_type_list(IsA(http.HttpRequest)).\
|
||||
AndReturn(self.volume_types.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).\
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).\
|
||||
AndReturn(self.cinder_volume_snapshots.list())
|
||||
api.glance.image_list_detailed(
|
||||
IsA(http.HttpRequest),
|
||||
@ -208,7 +214,8 @@ class VolumeViewTests(test.TestCase):
|
||||
'status': 'active'}) \
|
||||
.AndReturn([[], False, False])
|
||||
cinder.volume_list(IsA(
|
||||
http.HttpRequest)).AndReturn(self.cinder_volumes.list())
|
||||
http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).AndReturn(self.cinder_volumes.list())
|
||||
quotas.tenant_limit_usages(IsA(http.HttpRequest)).\
|
||||
AndReturn(usage_limit)
|
||||
|
||||
@ -310,11 +317,12 @@ class VolumeViewTests(test.TestCase):
|
||||
'volume_source_type': 'volume_source',
|
||||
'volume_source': volume.id}
|
||||
|
||||
cinder.volume_list(IsA(http.HttpRequest)).\
|
||||
cinder.volume_list(IsA(http.HttpRequest), search_opts=SEARCH_OPTS).\
|
||||
AndReturn(self.cinder_volumes.list())
|
||||
cinder.volume_type_list(IsA(http.HttpRequest)).\
|
||||
AndReturn(self.volume_types.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).\
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).\
|
||||
AndReturn(self.cinder_volume_snapshots.list())
|
||||
quotas.tenant_limit_usages(IsA(http.HttpRequest)).\
|
||||
AndReturn(usage_limit)
|
||||
@ -381,7 +389,8 @@ class VolumeViewTests(test.TestCase):
|
||||
|
||||
cinder.volume_type_list(IsA(http.HttpRequest)).\
|
||||
AndReturn(self.volume_types.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).\
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).\
|
||||
AndReturn(self.cinder_volume_snapshots.list())
|
||||
api.glance.image_list_detailed(
|
||||
IsA(http.HttpRequest),
|
||||
@ -393,7 +402,8 @@ class VolumeViewTests(test.TestCase):
|
||||
'status': 'active'}) \
|
||||
.AndReturn([[], False, False])
|
||||
cinder.volume_list(IsA(
|
||||
http.HttpRequest)).AndReturn(self.cinder_volumes.list())
|
||||
http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).AndReturn(self.cinder_volumes.list())
|
||||
quotas.tenant_limit_usages(IsA(http.HttpRequest)).\
|
||||
AndReturn(usage_limit)
|
||||
cinder.volume_snapshot_get(IsA(http.HttpRequest),
|
||||
@ -544,7 +554,8 @@ class VolumeViewTests(test.TestCase):
|
||||
|
||||
cinder.volume_type_list(IsA(http.HttpRequest)).\
|
||||
AndReturn(self.volume_types.list())
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).\
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).\
|
||||
AndReturn(self.cinder_volume_snapshots.list())
|
||||
api.glance.image_list_detailed(
|
||||
IsA(http.HttpRequest),
|
||||
@ -556,7 +567,8 @@ class VolumeViewTests(test.TestCase):
|
||||
'status': 'active'}) \
|
||||
.AndReturn([[], False, False])
|
||||
cinder.volume_list(IsA(
|
||||
http.HttpRequest)).AndReturn(self.cinder_volumes.list())
|
||||
http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).AndReturn(self.cinder_volumes.list())
|
||||
quotas.tenant_limit_usages(IsA(http.HttpRequest)) \
|
||||
.AndReturn(usage_limit)
|
||||
api.glance.image_get(IsA(http.HttpRequest),
|
||||
@ -708,7 +720,8 @@ class VolumeViewTests(test.TestCase):
|
||||
AndReturn(self.volume_types.list())
|
||||
quotas.tenant_limit_usages(IsA(http.HttpRequest)).\
|
||||
AndReturn(usage_limit)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).\
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).\
|
||||
AndReturn(self.cinder_volume_snapshots.list())
|
||||
api.glance.image_list_detailed(
|
||||
IsA(http.HttpRequest),
|
||||
@ -720,7 +733,8 @@ class VolumeViewTests(test.TestCase):
|
||||
'status': 'active'}) \
|
||||
.AndReturn([[], False, False])
|
||||
cinder.volume_list(IsA(
|
||||
http.HttpRequest)).AndReturn(self.cinder_volumes.list())
|
||||
http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).AndReturn(self.cinder_volumes.list())
|
||||
cinder.extension_supported(IsA(http.HttpRequest), 'AvailabilityZones')\
|
||||
.AndReturn(True)
|
||||
cinder.availability_zone_list(IsA(http.HttpRequest)).AndReturn(
|
||||
@ -758,7 +772,8 @@ class VolumeViewTests(test.TestCase):
|
||||
AndReturn(self.volume_types.list())
|
||||
quotas.tenant_limit_usages(IsA(http.HttpRequest)).\
|
||||
AndReturn(usage_limit)
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest)).\
|
||||
cinder.volume_snapshot_list(IsA(http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).\
|
||||
AndReturn(self.cinder_volume_snapshots.list())
|
||||
api.glance.image_list_detailed(
|
||||
IsA(http.HttpRequest),
|
||||
@ -770,7 +785,8 @@ class VolumeViewTests(test.TestCase):
|
||||
'status': 'active'}) \
|
||||
.AndReturn([[], False, False])
|
||||
cinder.volume_list(IsA(
|
||||
http.HttpRequest)).AndReturn(self.cinder_volumes.list())
|
||||
http.HttpRequest),
|
||||
search_opts=SEARCH_OPTS).AndReturn(self.cinder_volumes.list())
|
||||
cinder.extension_supported(IsA(http.HttpRequest), 'AvailabilityZones')\
|
||||
.AndReturn(True)
|
||||
cinder.availability_zone_list(IsA(http.HttpRequest)).AndReturn(
|
||||
|
Loading…
Reference in New Issue
Block a user