Merge "Cleanup the exception LiveMigrationWithOldNovaNotSafe"
This commit is contained in:
@@ -333,8 +333,7 @@ class AdminActionsController(wsgi.Controller):
|
|||||||
exception.InvalidLocalStorage,
|
exception.InvalidLocalStorage,
|
||||||
exception.InvalidSharedStorage,
|
exception.InvalidSharedStorage,
|
||||||
exception.HypervisorUnavailable,
|
exception.HypervisorUnavailable,
|
||||||
exception.MigrationPreCheckError,
|
exception.MigrationPreCheckError) as ex:
|
||||||
exception.LiveMigrationWithOldNovaNotSafe) as ex:
|
|
||||||
raise exc.HTTPBadRequest(explanation=ex.format_message())
|
raise exc.HTTPBadRequest(explanation=ex.format_message())
|
||||||
except exception.InstanceNotFound as e:
|
except exception.InstanceNotFound as e:
|
||||||
raise exc.HTTPNotFound(explanation=e.format_message())
|
raise exc.HTTPNotFound(explanation=e.format_message())
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ class MigrateServerController(wsgi.Controller):
|
|||||||
exception.InvalidSharedStorage,
|
exception.InvalidSharedStorage,
|
||||||
exception.HypervisorUnavailable,
|
exception.HypervisorUnavailable,
|
||||||
exception.MigrationPreCheckError,
|
exception.MigrationPreCheckError,
|
||||||
exception.LiveMigrationWithOldNovaNotSafe,
|
|
||||||
exception.LiveMigrationWithOldNovaNotSupported) as ex:
|
exception.LiveMigrationWithOldNovaNotSupported) as ex:
|
||||||
raise exc.HTTPBadRequest(explanation=ex.format_message())
|
raise exc.HTTPBadRequest(explanation=ex.format_message())
|
||||||
except exception.InstanceIsLocked as e:
|
except exception.InstanceIsLocked as e:
|
||||||
|
|||||||
@@ -172,7 +172,6 @@ class ComputeTaskManager(base.Base):
|
|||||||
exception.HypervisorUnavailable,
|
exception.HypervisorUnavailable,
|
||||||
exception.InstanceInvalidState,
|
exception.InstanceInvalidState,
|
||||||
exception.MigrationPreCheckError,
|
exception.MigrationPreCheckError,
|
||||||
exception.LiveMigrationWithOldNovaNotSafe,
|
|
||||||
exception.LiveMigrationWithOldNovaNotSupported,
|
exception.LiveMigrationWithOldNovaNotSupported,
|
||||||
exception.UnsupportedPolicyException)
|
exception.UnsupportedPolicyException)
|
||||||
def migrate_server(self, context, instance, scheduler_hint, live, rebuild,
|
def migrate_server(self, context, instance, scheduler_hint, live, rebuild,
|
||||||
@@ -320,7 +319,6 @@ class ComputeTaskManager(base.Base):
|
|||||||
exception.HypervisorUnavailable,
|
exception.HypervisorUnavailable,
|
||||||
exception.InstanceInvalidState,
|
exception.InstanceInvalidState,
|
||||||
exception.MigrationPreCheckError,
|
exception.MigrationPreCheckError,
|
||||||
exception.LiveMigrationWithOldNovaNotSafe,
|
|
||||||
exception.LiveMigrationWithOldNovaNotSupported,
|
exception.LiveMigrationWithOldNovaNotSupported,
|
||||||
exception.MigrationSchedulerRPCError) as ex:
|
exception.MigrationSchedulerRPCError) as ex:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
|
|||||||
@@ -1869,12 +1869,6 @@ class NoLiveMigrationForConfigDriveInLibVirt(NovaException):
|
|||||||
"drive data is shared across compute nodes.")
|
"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):
|
class LiveMigrationWithOldNovaNotSupported(NovaException):
|
||||||
msg_fmt = _("Live migration with API v2.25 requires all the Mitaka "
|
msg_fmt = _("Live migration with API v2.25 requires all the Mitaka "
|
||||||
"upgrade to be complete before it is available.")
|
"upgrade to be complete before it is available.")
|
||||||
|
|||||||
@@ -264,10 +264,6 @@ class MigrateServerTestsV21(admin_only_action_common.CommonTests):
|
|||||||
self._test_migrate_live_failed_with_exception(
|
self._test_migrate_live_failed_with_exception(
|
||||||
exception.MigrationPreCheckError(reason=''))
|
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):
|
def test_migrate_live_migration_with_unexpected_error(self):
|
||||||
self._test_migrate_live_failed_with_exception(
|
self._test_migrate_live_failed_with_exception(
|
||||||
exception.MigrationError(reason=''),
|
exception.MigrationError(reason=''),
|
||||||
|
|||||||
@@ -1300,7 +1300,6 @@ class ConductorTaskTestCase(_BaseTaskTestCase, test_compute.BaseTestCase):
|
|||||||
state='', method=''),
|
state='', method=''),
|
||||||
exc.DestinationHypervisorTooOld(),
|
exc.DestinationHypervisorTooOld(),
|
||||||
exc.HypervisorUnavailable(host='dummy'),
|
exc.HypervisorUnavailable(host='dummy'),
|
||||||
exc.LiveMigrationWithOldNovaNotSafe(server='dummy'),
|
|
||||||
exc.LiveMigrationWithOldNovaNotSupported(),
|
exc.LiveMigrationWithOldNovaNotSupported(),
|
||||||
exc.MigrationPreCheckError(reason='dummy'),
|
exc.MigrationPreCheckError(reason='dummy'),
|
||||||
exc.InvalidSharedStorage(path='dummy', reason='dummy'),
|
exc.InvalidSharedStorage(path='dummy', reason='dummy'),
|
||||||
|
|||||||
Reference in New Issue
Block a user