diff --git a/vrtManager/storage.py b/vrtManager/storage.py index e75c8a9a..d63738dc 100644 --- a/vrtManager/storage.py +++ b/vrtManager/storage.py @@ -155,7 +155,8 @@ class wvmStorage(wvmConnect): return "Unknown" def get_size(self): - return [self.pool.info()[1], self.pool.info()[3]] + _state, capacity, _allocation, available = self.pool.info() + return [capacity, available] def _XMLDesc(self, flags): return self.pool.XMLDesc(flags) diff --git a/vrtManager/tests/test_host_reads.py b/vrtManager/tests/test_host_reads.py index 70f41d66..adcec488 100644 --- a/vrtManager/tests/test_host_reads.py +++ b/vrtManager/tests/test_host_reads.py @@ -285,6 +285,12 @@ class VolumesTestCase(unittest.TestCase): stg.pool.storageVolLookupByName.return_value = volume("a.img", 4096, 0, "raw") self.assertEqual(stg.get_volume_details("a.img"), {"name": "a.img", "size": 4096, "allocation": 0, "type": "raw"}) + def test_the_pool_size_is_one_info_call(self): + stg = self.storage([]) + stg.pool.info.return_value = [2, 500, 380, 120] + self.assertEqual(stg.get_size(), [500, 120]) + stg.pool.info.assert_called_once_with() + def host(*readings): """A wvmHostDetails whose getCPUStats returns readings, (idle, busy) each."""