Don't pass disk_format or container_format to image task upload

In task upload we update the image properties after importing the image.
Attempting to set disk_format/container_format at that point is not the
right choice in life.

Depends-On: https://review.openstack.org/613438
Change-Id: I3b086e83514a71cea0bb4119d75c48c153099141
This commit is contained in:
Monty Taylor 2018-10-24 20:59:55 +02:00
parent 448cda91e3
commit c080f5a2af
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
3 changed files with 10 additions and 2 deletions

View File

@ -4973,12 +4973,13 @@ class _OpenStackCloudMixin(_normalize.Normalizer):
self, name, filename, self, name, filename,
wait, timeout, meta, **image_kwargs): wait, timeout, meta, **image_kwargs):
properties = image_kwargs['properties'] properties = image_kwargs.pop('properties', {})
md5 = properties[self._IMAGE_MD5_KEY] md5 = properties[self._IMAGE_MD5_KEY]
sha256 = properties[self._IMAGE_SHA256_KEY] sha256 = properties[self._IMAGE_SHA256_KEY]
container = properties[self._IMAGE_OBJECT_KEY].split('/', 1)[0] container = properties[self._IMAGE_OBJECT_KEY].split('/', 1)[0]
properties = image_kwargs.pop('properties', {})
image_kwargs.update(properties) image_kwargs.update(properties)
image_kwargs.pop('disk_format', None)
image_kwargs.pop('container_format', None)
self.create_container(container) self.create_container(container)
self.create_object( self.create_object(

View File

@ -487,6 +487,7 @@ class TestImage(BaseTestImage):
self.cloud.create_image( self.cloud.create_image(
self.image_name, self.imagefile.name, wait=True, timeout=1, self.image_name, self.imagefile.name, wait=True, timeout=1,
disk_format='vhd', container_format='ovf',
is_public=False, container=self.container_name) is_public=False, container=self.container_name)
self.assert_calls() self.assert_calls()

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixed a regression in image upload when the cloud uses the task
upload method. A refactor led to attempting to update the disk_format
and container_format values after the image had been imported.