diff --git a/nova/api/openstack/compute/migrate_server.py b/nova/api/openstack/compute/migrate_server.py index f67e10a50c5b..2f93450cf8e9 100644 --- a/nova/api/openstack/compute/migrate_server.py +++ b/nova/api/openstack/compute/migrate_server.py @@ -77,7 +77,6 @@ class MigrateServerController(wsgi.Controller): except (exception.TooManyInstances, exception.QuotaError) as e: raise exc.HTTPForbidden(explanation=e.format_message()) except (exception.InstanceIsLocked, - exception.CannotMigrateWithTargetHost, exception.AllocationMoveFailed) as e: raise exc.HTTPConflict(explanation=e.format_message()) except exception.InstanceInvalidState as state_error: diff --git a/nova/exception.py b/nova/exception.py index 87518a89c3db..c7dce6c39d29 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -2312,11 +2312,6 @@ class TraitCreationFailed(NovaException): msg_fmt = _("Failed to create trait %(name)s: %(error)s") -class CannotMigrateWithTargetHost(NovaException): - msg_fmt = _("Cannot migrate with target host. Retry without a host " - "specified.") - - class CannotMigrateToSameHost(NovaException): msg_fmt = _("Cannot migrate to the host where the server exists.") diff --git a/nova/tests/unit/api/openstack/compute/test_migrate_server.py b/nova/tests/unit/api/openstack/compute/test_migrate_server.py index 99572af1bd1c..fca646c3287d 100644 --- a/nova/tests/unit/api/openstack/compute/test_migrate_server.py +++ b/nova/tests/unit/api/openstack/compute/test_migrate_server.py @@ -581,10 +581,6 @@ class MigrateServerTestsV256(MigrateServerTestsV234): exc_info = exception.ComputeHostNotFound(host='nonexistent_host') self._test_migrate_exception(exc_info, webob.exc.HTTPBadRequest) - def test_migrate_no_request_spec(self): - exc_info = exception.CannotMigrateWithTargetHost() - self._test_migrate_exception(exc_info, webob.exc.HTTPConflict) - def test_migrate_to_same_host(self): exc_info = exception.CannotMigrateToSameHost() self._test_migrate_exception(exc_info, webob.exc.HTTPBadRequest)