Fix images minimum ram and disk default values

When uploading an image, if we do not set a minimum ram and disk size we
try to send "None" to glance.
We should instead send "0" and glance will calculate the size from the
provided image.

Change-Id: Ia1aeabcdcf021943ebb7a4e35939c383ac820b19
Closes-Bug: #1809121
This commit is contained in:
Yves-Gwenael Bourhis 2018-12-19 15:11:20 +01:00
parent 63c4a321e7
commit 65b21e7f9d

View File

@ -457,8 +457,8 @@ def create_image_metadata(data):
meta = {'protected': data.get('protected', False),
'disk_format': data.get('disk_format', 'raw'),
'container_format': data.get('container_format', 'bare'),
'min_disk': data.get('min_disk', 0),
'min_ram': data.get('min_ram', 0),
'min_disk': data.get('min_disk') or 0,
'min_ram': data.get('min_ram') or 0,
'name': data.get('name', '')}
# Glance does not really do anything with container_format at the