From 91da50d0c7e910249dbb66d2c2460a1536e54830 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 6 Jul 2015 15:22:12 -0700 Subject: [PATCH] Fix incorrect enum in Migration object and DB model The migration object and model incorrectly mirrored the migration_type enum from the database schema. Since the affected type (evacuation) has never been used before this change, we can just make the swap with no version bump. Related to blueprint robustify-evacuation Change-Id: If502903fecd315e24c987da6d78b73dcc1305ee3 --- nova/db/sqlalchemy/models.py | 2 +- nova/objects/migration.py | 2 +- nova/tests/unit/objects/test_objects.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py index edd8cd08a20e..bc506fd30c44 100644 --- a/nova/db/sqlalchemy/models.py +++ b/nova/db/sqlalchemy/models.py @@ -742,7 +742,7 @@ class Migration(BASE, NovaBase): # TODO(_cerberus_): enum status = Column(String(255)) migration_type = Column(Enum('migration', 'resize', 'live-migration', - 'evacuate'), + 'evacuation'), nullable=True) hidden = Column(Boolean, default=False) diff --git a/nova/objects/migration.py b/nova/objects/migration.py index c8469f6758d9..d183e8bbf78c 100644 --- a/nova/objects/migration.py +++ b/nova/objects/migration.py @@ -48,7 +48,7 @@ class Migration(base.NovaPersistentObject, base.NovaObject, 'instance_uuid': fields.StringField(nullable=True), 'status': fields.StringField(nullable=True), 'migration_type': fields.EnumField(['migration', 'resize', - 'live-migration', 'evacuate'], + 'live-migration', 'evacuation'], nullable=False), 'hidden': fields.BooleanField(nullable=False, default=False), } diff --git a/nova/tests/unit/objects/test_objects.py b/nova/tests/unit/objects/test_objects.py index 5456e590dde8..2cd79f157d67 100644 --- a/nova/tests/unit/objects/test_objects.py +++ b/nova/tests/unit/objects/test_objects.py @@ -1099,7 +1099,7 @@ object_data = { 'InstancePCIRequests': '1.1-fc8d179960869c9af038205a80af2541', 'KeyPair': '1.3-bfaa2a8b148cdf11e0c72435d9dd097a', 'KeyPairList': '1.2-60f984184dc5a8eba6e34e20cbabef04', - 'Migration': '1.2-331b1f37d0b20b932614181b9832c860', + 'Migration': '1.2-8784125bedcea0a9227318511904e853', 'MigrationList': '1.2-5e79c0693d7ebe4e9ac03b5db11ab243', 'NUMACell': '1.2-74fc993ac5c83005e76e34e8487f1c05', 'NUMAPagesTopology': '1.0-c71d86317283266dc8364c149155e48e',