Seagate driver: fix get_volume_size()

The driver was reporting volume sizes in units of GB (10^9), the
default format the native array UIs, rather than GiB (2^30).  This
change also affects the HPE MSA, Dell PowerVault, and Lenovo drivers
as they use the same code.

Change-Id: I038f1399812e6c053622751eb62df89eff8a33db
This commit is contained in:
Chris M 2021-09-20 05:24:14 +00:00
parent 4c2f2b460b
commit 4653773bc0
3 changed files with 8 additions and 3 deletions

View File

@ -255,8 +255,8 @@ class TestSeagateClient(test.TestCase):
@mock.patch.object(STXClient, '_request')
def test_backend_stats(self, mock_request):
stats = {'free_capacity_gb': 1979,
'total_capacity_gb': 1979}
stats = {'free_capacity_gb': 1843,
'total_capacity_gb': 1843}
linear = etree.XML(response_stats_linear)
virtual = etree.XML(response_stats_virtual)
mock_request.side_effect = [linear, virtual]

View File

@ -338,7 +338,7 @@ class STXClient(object):
return False
def _get_size(self, size):
return int(math.ceil(float(size) * 512 / (units.G)))
return int(math.ceil(float(size) * 512 / (units.Gi)))
def backend_stats(self, backend_name, backend_type):
stats = {'free_capacity_gb': 0,

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Seagate, HPE MSA, Dell PowerVault, Lenovo drivers: report volume
size in GiB (2^30) rather than GB (10^9).