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
(cherry picked from commit 65b21e7f9d)
This commit is contained in:
Yves-Gwenael Bourhis 2018-12-19 15:11:20 +01:00
parent 85fef71c0d
commit d2720d9710
1 changed files with 2 additions and 2 deletions

View File

@ -431,8 +431,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