summaryrefslogtreecommitdiff
path: root/nova/tests/unit/objects/test_image_meta.py
diff options
context:
space:
mode:
authorGary Kotton <gkotton@vmware.com>2015-10-15 05:42:59 -0700
committerGary Kotton <gkotton@vmware.com>2015-10-17 08:10:48 -0700
commit70f4299450a260465102f879758f79160223dc29 (patch)
treea2e9e0c863f0492aa65fe53ef509b2e60b7917d9 /nova/tests/unit/objects/test_image_meta.py
parent16111bd236c331648d15eca44bebc7256e331f67 (diff)
downloadnova-70f4299450a260465102f879758f79160223dc29.tar.gz
Image meta: treat legacy vmware adapter type values
Ensure that legacy metadata vmware_adaptertype values are treated correctly. This value could have been set as "" and there are existing deployments that use that. Change-Id: I28e9ca9075f33ff19855408af02bc454780e7c79 Closes-bug: #1506465
Diffstat (limited to 'nova/tests/unit/objects/test_image_meta.py')
-rw-r--r--nova/tests/unit/objects/test_image_meta.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/tests/unit/objects/test_image_meta.py b/nova/tests/unit/objects/test_image_meta.py
index d86071aff7..ae7dae3b6f 100644
--- a/nova/tests/unit/objects/test_image_meta.py
+++ b/nova/tests/unit/objects/test_image_meta.py
@@ -185,7 +185,7 @@ class TestImageMetaProps(test.NoDBTestCase):
def test_legacy_compat_vmware_adapter_types(self):
legacy_types = ['lsiLogic', 'busLogic', 'ide', 'lsiLogicsas',
- 'paraVirtual']
+ 'paraVirtual', None, '']
for legacy_type in legacy_types:
legacy_props = {
@@ -195,6 +195,9 @@ class TestImageMetaProps(test.NoDBTestCase):
image_meta = objects.ImageMetaProps.from_dict(legacy_props)
if legacy_type == 'ide':
self.assertEqual('ide', image_meta.hw_disk_bus)
+ elif not legacy_type:
+ self.assertFalse(image_meta.obj_attr_is_set('hw_disk_bus'))
+ self.assertFalse(image_meta.obj_attr_is_set('hw_scsi_model'))
else:
self.assertEqual('scsi', image_meta.hw_disk_bus)
if legacy_type == 'lsiLogicsas':