Skip to content

Commit 5e28a2b

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Remove MIN_COMPUTE_MULTIATTACH conditions in API"
2 parents 7257c41 + 544cfed commit 5e28a2b

File tree

4 files changed

+2
-39
lines changed

4 files changed

+2
-39
lines changed

nova/api/openstack/compute/servers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,6 @@ def create(self, req, body):
750750
exception.InstanceExists,
751751
exception.NetworkAmbiguous,
752752
exception.NoUniqueMatch,
753-
exception.MultiattachSupportNotYetAvailable,
754753
exception.VolumeTypeSupportNotYetAvailable,
755754
exception.CertificateValidationNotYetAvailable) as error:
756755
raise exc.HTTPConflict(explanation=error.format_message())

nova/compute/api.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
AGGREGATE_ACTION_DELETE = 'Delete'
106106
AGGREGATE_ACTION_ADD = 'Add'
107107
CINDER_V3_ATTACH_MIN_COMPUTE_VERSION = 24
108-
MIN_COMPUTE_MULTIATTACH = 27
109108
MIN_COMPUTE_TRUSTED_CERTS = 31
110109
MIN_COMPUTE_ABORT_QUEUED_LIVE_MIGRATION = 34
111110
MIN_COMPUTE_VOLUME_TYPE = 36
@@ -1596,8 +1595,7 @@ def _validate_bdm(self, context, instance, instance_type,
15961595
bdm.attachment_id = None
15971596
except (exception.CinderConnectionFailed,
15981597
exception.InvalidVolume,
1599-
exception.MultiattachNotSupportedOldMicroversion,
1600-
exception.MultiattachSupportNotYetAvailable):
1598+
exception.MultiattachNotSupportedOldMicroversion):
16011599
raise
16021600
except exception.InvalidInput as exc:
16031601
raise exception.InvalidVolume(reason=exc.format_message())
@@ -4172,11 +4170,6 @@ def _check_attach_and_reserve_volume(self, context, volume, instance,
41724170
min_compute_version = \
41734171
objects.service.get_minimum_version_all_cells(
41744172
context, ['nova-compute'])
4175-
# Check to see if the computes have been upgraded to support
4176-
# booting from a multiattach volume.
4177-
if (volume['multiattach'] and
4178-
min_compute_version < MIN_COMPUTE_MULTIATTACH):
4179-
raise exception.MultiattachSupportNotYetAvailable()
41804173

41814174
if min_compute_version >= CINDER_V3_ATTACH_MIN_COMPUTE_VERSION:
41824175
# Attempt a new style volume attachment, but fallback to old-style

nova/tests/unit/api/openstack/compute/test_serversV21.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6418,17 +6418,6 @@ def test_create_server_with_multiattach_fails_old_microversion(self):
64186418
self.assertIn('Multiattach volumes are only supported starting with '
64196419
'compute API version 2.60', six.text_type(ex))
64206420

6421-
@mock.patch('nova.objects.service.get_minimum_version_all_cells',
6422-
return_value=compute_api.MIN_COMPUTE_MULTIATTACH - 1)
6423-
def test_create_server_with_multiattach_fails_not_available(
6424-
self, mock_get_min_version_all_cells):
6425-
"""Tests the case that the user tries to boot from volume with a
6426-
multiattach volume but before the deployment is fully upgraded.
6427-
"""
6428-
ex = self.assertRaises(webob.exc.HTTPConflict, self._post_server)
6429-
self.assertIn('Multiattach volume support is not yet available',
6430-
six.text_type(ex))
6431-
64326421

64336422
class ServersControllerCreateTestV263(ServersControllerCreateTest):
64346423
def _create_instance_req(self, certs=None):

nova/tests/unit/compute/test_compute_api.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6622,26 +6622,8 @@ def test_check_attach_and_reserve_volume_multiattach_old_version(self):
66226622
self.context, volume, instance, bdm,
66236623
supports_multiattach=False)
66246624

6625-
@mock.patch('nova.objects.service.get_minimum_version_all_cells',
6626-
return_value=compute_api.MIN_COMPUTE_MULTIATTACH - 1)
6627-
def test_check_attach_and_reserve_volume_multiattach_new_inst_old_compute(
6628-
self, get_min_version):
6629-
"""Tests that _check_attach_and_reserve_volume fails if trying
6630-
to use a multiattach volume to create a new instance but the computes
6631-
are not all upgraded yet.
6632-
"""
6633-
instance = self._create_instance_obj()
6634-
delattr(instance, 'id')
6635-
volume = {'id': uuids.volumeid, 'multiattach': True}
6636-
bdm = objects.BlockDeviceMapping(volume_id=uuids.volumeid,
6637-
instance_uuid=instance.uuid)
6638-
self.assertRaises(exception.MultiattachSupportNotYetAvailable,
6639-
self.compute_api._check_attach_and_reserve_volume,
6640-
self.context, volume, instance, bdm,
6641-
supports_multiattach=True)
6642-
66436625
@mock.patch('nova.objects.Service.get_minimum_version',
6644-
return_value=compute_api.MIN_COMPUTE_MULTIATTACH)
6626+
return_value=compute_api.CINDER_V3_ATTACH_MIN_COMPUTE_VERSION)
66456627
@mock.patch('nova.volume.cinder.API.get',
66466628
return_value={'id': uuids.volumeid, 'multiattach': True})
66476629
@mock.patch('nova.volume.cinder.is_microversion_supported',

0 commit comments

Comments
 (0)