Ensure cloned volume size is int type

This commit is contained in:
Joshua Boniface 2021-03-15 15:12:24 -04:00
parent 593c9a7e0d
commit 4e58b18976
1 changed files with 2 additions and 2 deletions

View File

@ -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']