Change the type of "free_capacity_gb" from string to float
in function _get_free_capacity.
Fix bug:
1177678
Change-Id: If2654fc3ad6b3dbea6a8cc0be7ae041ad30bf876
def _test_get_get_volume_stats(self):
stats = self.driver.get_volume_stats(True)
- fakecapacity = str(int(float(FakePoolInfo['Free Capacity']) / 1024))
+ fakecapacity = float(FakePoolInfo['Free Capacity']) / 1024
self.assertEqual(stats['free_capacity_gb'], fakecapacity)
lun_type = 'Thick'
poolinfo_dev = self._find_pool_info(lun_type)
pools_conf = root.findall('LUN/StoragePool')
- total_free_capacity = 0
+ total_free_capacity = 0.0
for poolinfo in poolinfo_dev:
if self.device_type['type'] == 'Dorado2100 G2':
total_free_capacity += float(poolinfo[2])
total_free_capacity += float(poolinfo[4])
break
- return str(int(total_free_capacity / 1024))
+ return total_free_capacity / 1024