Skip to content

Commit d52c084

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Remove 'MultiattachSupportNotYetAvailable' exception"
2 parents 1b9764d + e750c8e commit d52c084

File tree

3 files changed

+1
-25
lines changed

3 files changed

+1
-25
lines changed

nova/api/openstack/compute/volumes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ def create(self, req, server_id, body):
339339
raise exc.HTTPNotFound(explanation=e.format_message())
340340
except (exception.InstanceIsLocked,
341341
exception.DevicePathInUse,
342-
exception.MultiattachNotSupportedByVirtDriver,
343-
exception.MultiattachSupportNotYetAvailable) as e:
342+
exception.MultiattachNotSupportedByVirtDriver) as e:
344343
raise exc.HTTPConflict(explanation=e.format_message())
345344
except exception.InstanceInvalidState as state_error:
346345
common.raise_http_conflict_for_instance_invalid_state(state_error,

nova/exception.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,6 @@ class MultiattachNotSupportedByVirtDriver(NovaException):
282282
code = 409
283283

284284

285-
class MultiattachSupportNotYetAvailable(NovaException):
286-
# This exception indicates the deployment is not yet new enough to support
287-
# multiattach volumes, so a 409 HTTPConflict response is generally used
288-
# for handling this in the API.
289-
msg_fmt = _("Multiattach volume support is not yet available.")
290-
code = 409
291-
292-
293285
class MultiattachNotSupportedOldMicroversion(Invalid):
294286
msg_fmt = _('Multiattach volumes are only supported starting with '
295287
'compute API version 2.60.')

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -924,21 +924,6 @@ def test_attach_with_multiattach_fails_old_microversion(self):
924924
self.assertIn('Multiattach volumes are only supported starting with '
925925
'compute API version 2.60', six.text_type(ex))
926926

927-
def test_attach_with_multiattach_fails_not_available(self):
928-
"""Tests the case that the user tries to attach with a
929-
multiattach volume on cells v1 where multiattach volumes are
930-
not supported.
931-
"""
932-
with mock.patch.object(
933-
self.controller.compute_api, 'attach_volume',
934-
side_effect=
935-
exception.MultiattachSupportNotYetAvailable) as attach:
936-
ex = self.assertRaises(webob.exc.HTTPConflict, self._post_attach)
937-
create_kwargs = attach.call_args[1]
938-
self.assertTrue(create_kwargs['supports_multiattach'])
939-
self.assertIn('Multiattach volume support is not yet available',
940-
six.text_type(ex))
941-
942927
def test_attach_with_multiattach_fails_not_supported_by_driver(self):
943928
"""Tests the case that the user tries to attach with a
944929
multiattach volume but the compute hosting the instance does

0 commit comments

Comments
 (0)