Merge "image: Don't envelope properties"

This commit is contained in:
Zuul 2023-05-16 12:09:15 +00:00 committed by Gerrit Code Review
commit c879609fa9
3 changed files with 9 additions and 10 deletions

View File

@ -332,6 +332,8 @@ class Proxy(proxy.Proxy):
**image_kwargs,
)
else:
properties = image_kwargs.pop('properties', {})
image_kwargs.update(self._make_v2_image_params(meta, properties))
image_kwargs['name'] = name
image = self._create(_image.Image, **image_kwargs)

View File

@ -27,11 +27,6 @@ class TestImage(base.BaseImageTest):
name=TEST_IMAGE_NAME,
disk_format='raw',
container_format='bare',
# TODO(mordred): This is not doing what people think it is doing.
# This is EPICLY broken. However, rather than fixing it as it is,
# we need to just replace the image upload code with the stuff
# from shade. Figuring out mapping the crap-tastic arbitrary
# extra key-value pairs into Resource is going to be fun.
properties={
'description': 'This is not an image',
},

View File

@ -96,7 +96,7 @@ class TestImage(TestImageProxy):
)
self.assertIn('filename and data are mutually exclusive', str(exc))
def test_image_create_minimal(self):
def test_image_create(self):
self.verify_create(
self.proxy.create_image,
_image.Image,
@ -105,12 +105,16 @@ class TestImage(TestImageProxy):
'disk_format': 'fake_dformat',
'container_format': 'fake_cformat',
'allow_duplicates': True,
'is_protected': True,
},
expected_kwargs={
'name': 'fake',
'disk_format': 'fake_dformat',
'container_format': 'fake_cformat',
'properties': mock.ANY,
'is_protected': True,
'owner_specified.openstack.md5': '',
'owner_specified.openstack.object': 'images/fake',
'owner_specified.openstack.sha256': '',
},
)
@ -187,9 +191,7 @@ class TestImage(TestImageProxy):
meta={},
properties={
self.proxy._IMAGE_MD5_KEY: '144c9defac04969c7bfad8efaa8ea194',
self.proxy._IMAGE_SHA256_KEY: 'b5d54c39e66671c9731b9f471e585'
'd8262cd4f54963f0c93082d8dcf33'
'4d4c78',
self.proxy._IMAGE_SHA256_KEY: 'b5d54c39e66671c9731b9f471e585d8262cd4f54963f0c93082d8dcf334d4c78', # noqa: E501
self.proxy._IMAGE_OBJECT_KEY: 'bare/fake',
},
timeout=3600,