Ensure cloned volume size is int type
This commit is contained in:
parent
593c9a7e0d
commit
4e58b18976
|
@ -1229,9 +1229,9 @@ def create_vm(self, vm_name, vm_profile, define_vm=True, start_vm=True, script_r
|
||||||
if not volume_data:
|
if not volume_data:
|
||||||
raise ClusterError('The source volume {}/{} could not be found.'.format(volume['pool'], volume['source_volume']))
|
raise ClusterError('The source volume {}/{} could not be found.'.format(volume['pool'], volume['source_volume']))
|
||||||
if not volume['pool'] in pools:
|
if not volume['pool'] in pools:
|
||||||
pools[volume['pool']] = volume_data['stats']['size'].replace('G', '')
|
pools[volume['pool']] = int(volume_data['stats']['size'].replace('G', ''))
|
||||||
else:
|
else:
|
||||||
pools[volume['pool']] += volume_data['stats']['size'].replace('G', '')
|
pools[volume['pool']] += int(volume_data['stats']['size'].replace('G', ''))
|
||||||
else:
|
else:
|
||||||
if not volume['pool'] in pools:
|
if not volume['pool'] in pools:
|
||||||
pools[volume['pool']] = volume['disk_size_gb']
|
pools[volume['pool']] = volume['disk_size_gb']
|
||||||
|
|
Loading…
Reference in New Issue