Merge "Remove unnecessary properties from image-meta"

This commit is contained in:
Jenkins 2016-06-29 19:28:45 +00:00 committed by Gerrit Code Review
commit ff60efbe74
2 changed files with 9 additions and 6 deletions

View File

@ -607,15 +607,17 @@ def upload_image(context, timeout_secs, image_service, image_id, owner_id,
kwargs.get('vmdk_file_path'),
file_size)
# TODO(vbala) Remove this after we delete the keyword argument 'is_public'
# from all client code.
if 'is_public' in kwargs:
LOG.debug("Ignoring keyword argument 'is_public'.")
# Set the image properties. It is important to set the 'size' to 0.
# Otherwise, the image service client will use the VM's disk capacity
# which will not be the image size after upload, since it is converted
# to a stream-optimized sparse disk.
image_metadata = {'disk_format': 'vmdk',
'is_public': kwargs.get('is_public'),
'name': kwargs.get('image_name'),
'status': 'active',
'container_format': 'bare',
'size': 0,
'properties': {'vmware_image_version':
kwargs.get('image_version'),

View File

@ -593,7 +593,11 @@ class ImageTransferUtilityTest(base.TestCase):
host = '127.0.0.1'
port = 443
file_path = '/fake_path'
# TODO(vbala) Remove this after we delete the keyword argument
# 'is_public' from all client code.
is_public = False
image_name = 'fake_image'
image_version = 1
@ -623,10 +627,7 @@ class ImageTransferUtilityTest(base.TestCase):
image_size)
image_metadata = {'disk_format': 'vmdk',
'is_public': is_public,
'name': image_name,
'status': 'active',
'container_format': 'bare',
'size': 0,
'properties': {'vmware_image_version': image_version,
'vmware_disktype': 'streamOptimized',