Re-add metadata to image in non-strict mode

In the old shade normalization we always made sure that properties
showed up in a field called metadata. When we reworked the normalization
recently, we missed that field. Add it back.

Change-Id: Ic39679d30b49d461feaed81ff162f3e8f4a694ac
This commit is contained in:
Monty Taylor 2016-11-29 08:36:03 -06:00
parent 7bbd0a9237
commit 93191ebe9b
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
2 changed files with 37 additions and 0 deletions

View File

@ -226,6 +226,7 @@ class Normalizer(object):
for key, val in properties.items():
new_image[key] = val
new_image['protected'] = protected
new_image['metadata'] = properties
new_image['created'] = new_image['created_at']
new_image['updated'] = new_image['updated_at']
new_image['minDisk'] = new_image['min_disk']

View File

@ -303,6 +303,25 @@ class TestUtils(base.TestCase):
'region_name': u'RegionOne',
'zone': None},
'locations': [],
'metadata': {
u'auto_disk_config': u'False',
u'com.rackspace__1__build_core': u'1',
u'com.rackspace__1__build_managed': u'1',
u'com.rackspace__1__build_rackconnect': u'1',
u'com.rackspace__1__options': u'0',
u'com.rackspace__1__source': u'import',
u'com.rackspace__1__visible_core': u'1',
u'com.rackspace__1__visible_managed': u'1',
u'com.rackspace__1__visible_rackconnect': u'1',
u'image_type': u'import',
u'org.openstack__1__architecture': u'x64',
u'os_type': u'linux',
u'user_id': u'156284',
u'vm_mode': u'hvm',
u'xenapi_use_agent': u'False',
'OS-DCF:diskConfig': u'MANUAL',
'progress': 100,
'request_ids': []},
'minDisk': 20,
'minRam': 0,
'min_disk': 20,
@ -428,6 +447,23 @@ class TestUtils(base.TestCase):
'region_name': u'RegionOne',
'zone': None},
'locations': [],
'metadata': {
u'auto_disk_config': u'False',
u'com.rackspace__1__build_core': u'1',
u'com.rackspace__1__build_managed': u'1',
u'com.rackspace__1__build_rackconnect': u'1',
u'com.rackspace__1__options': u'0',
u'com.rackspace__1__source': u'import',
u'com.rackspace__1__visible_core': u'1',
u'com.rackspace__1__visible_managed': u'1',
u'com.rackspace__1__visible_rackconnect': u'1',
u'image_type': u'import',
u'org.openstack__1__architecture': u'x64',
u'os_type': u'linux',
u'schema': u'/v2/schemas/image',
u'user_id': u'156284',
u'vm_mode': u'hvm',
u'xenapi_use_agent': u'False'},
'minDisk': 20,
'min_disk': 20,
'minRam': 0,