Browse Source

Merge "objects: Remove 'XenapiLiveMigrateData'"

changes/42/663542/9
Zuul 1 week ago
committed by Gerrit Code Review
parent
commit
51f698ece4
3 changed files with 0 additions and 66 deletions
  1. +0
    -35
      nova/objects/migrate_data.py
  2. +0
    -30
      nova/tests/unit/objects/test_migrate_data.py
  3. +0
    -1
      nova/tests/unit/objects/test_objects.py

+ 0
- 35
nova/objects/migrate_data.py View File

@@ -292,41 +292,6 @@ class LibvirtLiveMigrateData(LiveMigrateData):
return self.is_shared_block_storage or self.is_shared_instance_path


@obj_base.NovaObjectRegistry.register
class XenapiLiveMigrateData(LiveMigrateData):
# Version 1.0: Initial version
# Version 1.1: Added vif_uuid_map
# Version 1.2: Added old_vol_attachment_ids
# Version 1.3: Added wait_for_vif_plugged
# Version 1.4: Inherited vifs from LiveMigrateData
VERSION = '1.4'

fields = {
'block_migration': fields.BooleanField(nullable=True),
'destination_sr_ref': fields.StringField(nullable=True),
'migrate_send_data': fields.DictOfStringsField(nullable=True),
'sr_uuid_map': fields.DictOfStringsField(),
'kernel_file': fields.StringField(),
'ramdisk_file': fields.StringField(),
'vif_uuid_map': fields.DictOfStringsField(),
}

def obj_make_compatible(self, primitive, target_version):
super(XenapiLiveMigrateData, self).obj_make_compatible(
primitive, target_version)
target_version = versionutils.convert_version_to_tuple(target_version)
if target_version < (1, 4) and 'vifs' in primitive:
del primitive['vifs']
if target_version < (1, 3) and 'wait_for_vif_plugged' in primitive:
del primitive['wait_for_vif_plugged']
if target_version < (1, 2):
if 'old_vol_attachment_ids' in primitive:
del primitive['old_vol_attachment_ids']
if target_version < (1, 1):
if 'vif_uuid_map' in primitive:
del primitive['vif_uuid_map']


@obj_base.NovaObjectRegistry.register
class HyperVLiveMigrateData(LiveMigrateData):
# Version 1.0: Initial version


+ 0
- 30
nova/tests/unit/objects/test_migrate_data.py View File

@@ -190,36 +190,6 @@ class TestRemoteLibvirtLiveMigrateData(test_objects._RemoteTest,
pass


class _TestXenapiLiveMigrateData(object):
def test_obj_make_compatible(self):
obj = migrate_data.XenapiLiveMigrateData(
is_volume_backed=False,
block_migration=False,
destination_sr_ref='foo',
migrate_send_data={'key': 'val'},
sr_uuid_map={'apple': 'banana'},
vif_uuid_map={'orange': 'lemon'},
old_vol_attachment_ids={uuids.volume: uuids.attachment},
wait_for_vif_plugged=True)
primitive = obj.obj_to_primitive('1.0')
self.assertNotIn('vif_uuid_map', primitive['nova_object.data'])
primitive2 = obj.obj_to_primitive('1.1')
self.assertIn('vif_uuid_map', primitive2['nova_object.data'])
self.assertNotIn('old_vol_attachment_ids', primitive2)
primitive3 = obj.obj_to_primitive('1.2')['nova_object.data']
self.assertNotIn('wait_for_vif_plugged', primitive3)


class TestXenapiLiveMigrateData(test_objects._LocalTest,
_TestXenapiLiveMigrateData):
pass


class TestRemoteXenapiLiveMigrateData(test_objects._RemoteTest,
_TestXenapiLiveMigrateData):
pass


class _TestHyperVLiveMigrateData(object):
def test_obj_make_compatible(self):
obj = migrate_data.HyperVLiveMigrateData(


+ 0
- 1
nova/tests/unit/objects/test_objects.py View File

@@ -1155,7 +1155,6 @@ object_data = {
'VirtualInterfaceList': '1.0-9750e2074437b3077e46359102779fc6',
'VolumeUsage': '1.0-6c8190c46ce1469bb3286a1f21c2e475',
'XenDeviceBus': '1.0-272a4f899b24e31e42b2b9a7ed7e9194',
'XenapiLiveMigrateData': '1.4-7dc9417e921b2953faa6751f18785f3f',
# TODO(efried): re-alphabetize this
'LibvirtVPMEMDevice': '1.0-17ffaf47585199eeb9a2b83d6bde069f',
}


Loading…
Cancel
Save