From c52442a01fc38bbed53df6d3a84c3d128f78a0cc Mon Sep 17 00:00:00 2001 From: Marcellin Fom Tchassem Date: Mon, 21 Mar 2016 23:44:22 -0500 Subject: [PATCH] Cleanup the exception LiveMigrationWithOldNovaNotSafe It has been reported that the exception LiveMigrationWithOldNovaNotSafe is not useful since the change I5651fb7ba95f38e2e2f8a48a98ff04072c6bb885. This patch will cleanup the definition and the occurences of that exception. Change-Id: I7a5b677904d83104c4f5367b0245eebd422e2338 Closes-Bug: #1550282 --- .../openstack/compute/legacy_v2/contrib/admin_actions.py | 3 +-- nova/api/openstack/compute/migrate_server.py | 1 - nova/conductor/manager.py | 2 -- nova/exception.py | 6 ------ .../tests/unit/api/openstack/compute/test_migrate_server.py | 4 ---- nova/tests/unit/conductor/test_conductor.py | 1 - 6 files changed, 1 insertion(+), 16 deletions(-) diff --git a/nova/api/openstack/compute/legacy_v2/contrib/admin_actions.py b/nova/api/openstack/compute/legacy_v2/contrib/admin_actions.py index 19d0043d7866..ebd3c43e80e1 100644 --- a/nova/api/openstack/compute/legacy_v2/contrib/admin_actions.py +++ b/nova/api/openstack/compute/legacy_v2/contrib/admin_actions.py @@ -333,8 +333,7 @@ class AdminActionsController(wsgi.Controller): exception.InvalidLocalStorage, exception.InvalidSharedStorage, exception.HypervisorUnavailable, - exception.MigrationPreCheckError, - exception.LiveMigrationWithOldNovaNotSafe) as ex: + exception.MigrationPreCheckError) as ex: raise exc.HTTPBadRequest(explanation=ex.format_message()) except exception.InstanceNotFound as e: raise exc.HTTPNotFound(explanation=e.format_message()) diff --git a/nova/api/openstack/compute/migrate_server.py b/nova/api/openstack/compute/migrate_server.py index b1f4a5e70299..d2633a11e02a 100644 --- a/nova/api/openstack/compute/migrate_server.py +++ b/nova/api/openstack/compute/migrate_server.py @@ -103,7 +103,6 @@ class MigrateServerController(wsgi.Controller): exception.InvalidSharedStorage, exception.HypervisorUnavailable, exception.MigrationPreCheckError, - exception.LiveMigrationWithOldNovaNotSafe, exception.LiveMigrationWithOldNovaNotSupported) as ex: raise exc.HTTPBadRequest(explanation=ex.format_message()) except exception.InstanceIsLocked as e: diff --git a/nova/conductor/manager.py b/nova/conductor/manager.py index 2f6d89e9d8c0..15f422373c2e 100644 --- a/nova/conductor/manager.py +++ b/nova/conductor/manager.py @@ -172,7 +172,6 @@ class ComputeTaskManager(base.Base): exception.HypervisorUnavailable, exception.InstanceInvalidState, exception.MigrationPreCheckError, - exception.LiveMigrationWithOldNovaNotSafe, exception.LiveMigrationWithOldNovaNotSupported, exception.UnsupportedPolicyException) def migrate_server(self, context, instance, scheduler_hint, live, rebuild, @@ -320,7 +319,6 @@ class ComputeTaskManager(base.Base): exception.HypervisorUnavailable, exception.InstanceInvalidState, exception.MigrationPreCheckError, - exception.LiveMigrationWithOldNovaNotSafe, exception.LiveMigrationWithOldNovaNotSupported, exception.MigrationSchedulerRPCError) as ex: with excutils.save_and_reraise_exception(): diff --git a/nova/exception.py b/nova/exception.py index 40b82bf58345..d250c49e8334 100644 --- a/nova/exception.py +++ b/nova/exception.py @@ -1869,12 +1869,6 @@ class NoLiveMigrationForConfigDriveInLibVirt(NovaException): "drive data is shared across compute nodes.") -class LiveMigrationWithOldNovaNotSafe(NovaException): - msg_fmt = _("Host %(server)s is running an old version of Nova, " - "live migrations involving that version may cause data loss. " - "Upgrade Nova on %(server)s and try again.") - - class LiveMigrationWithOldNovaNotSupported(NovaException): msg_fmt = _("Live migration with API v2.25 requires all the Mitaka " "upgrade to be complete before it is available.") 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 5c3663329787..2d00de42db80 100644 --- a/nova/tests/unit/api/openstack/compute/test_migrate_server.py +++ b/nova/tests/unit/api/openstack/compute/test_migrate_server.py @@ -264,10 +264,6 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests): self._test_migrate_live_failed_with_exception( exception.MigrationPreCheckError(reason='')) - def test_migrate_live_migration_with_old_nova_not_safe(self): - self._test_migrate_live_failed_with_exception( - exception.LiveMigrationWithOldNovaNotSafe(server='')) - def test_migrate_live_migration_with_unexpected_error(self): self._test_migrate_live_failed_with_exception( exception.MigrationError(reason=''), diff --git a/nova/tests/unit/conductor/test_conductor.py b/nova/tests/unit/conductor/test_conductor.py index b89e82fac5ca..18ca94ae8ec6 100644 --- a/nova/tests/unit/conductor/test_conductor.py +++ b/nova/tests/unit/conductor/test_conductor.py @@ -1157,7 +1157,6 @@ class ConductorTaskTestCase(_BaseTaskTestCase, test_compute.BaseTestCase): state='', method=''), exc.DestinationHypervisorTooOld(), exc.HypervisorUnavailable(host='dummy'), - exc.LiveMigrationWithOldNovaNotSafe(server='dummy'), exc.LiveMigrationWithOldNovaNotSupported(), exc.MigrationPreCheckError(reason='dummy'), exc.InvalidSharedStorage(path='dummy', reason='dummy'),