Update one_vm.py (#43349)

OpenNebula 5.5.8  expects int in DISK_SIZE field when you create a vm, not a float.
For example, "42 GB" should be sent to OpenNebula API as "43088", not as "43088.0". MEMORY you cast to int explicitly, but DISK_SIZE not.
pull/43520/head^2
Max 6 years ago committed by ansibot
parent 49f34fec13
commit fe85d85ba6

@ -815,7 +815,7 @@ def create_disk_str(module, client, template_id, disk_size_str):
disk[child.tag] = child.text
result = 'DISK = [' + ','.join('{key}="{val}"'.format(key=key, val=val) for key, val in disk.items() if key != 'SIZE')
result += ', SIZE=' + str(get_size_in_MB(module, disk_size_str)) + ']\n'
result += ', SIZE=' + str(int(get_size_in_MB(module, disk_size_str))) + ']\n'
return result

Loading…
Cancel
Save