1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-11 12:46:49 +00:00

fix(instances): Refresh ISO list says which pools it could not read

A pool whose refresh failed, one busy with a volume copy for example,
was skipped without a word, so a hand-copied image stayed missing with
no reason given. The other pools are still refreshed; each failure is
shown with libvirt's error.

The API comment no longer says listing the ISO images refreshes pools.
This commit is contained in:
catborise 2026-11-02 16:03:44 +03:00
parent d5d054de71
commit b89672169f
5 changed files with 29 additions and 7 deletions

View file

@ -91,13 +91,21 @@ class IsoListTestCase(unittest.TestCase):
self.assertEqual(inst.get_iso_media(), ["b.iso"])
def test_refresh_reads_every_active_pool_again(self):
a, b = pool([], refresh_error=True), pool([])
a, b = pool([]), pool([])
inst = self.wvm(a, b)
inst.refresh_iso_pools()
self.assertEqual(inst.refresh_iso_pools(), {})
inst.wvm.listAllStoragePools.assert_called_once_with(VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE)
a.refresh.assert_called_once_with(0)
b.refresh.assert_called_once_with(0)
def test_a_failed_refresh_is_returned_and_the_others_still_run(self):
a, b = pool([], refresh_error=True), pool([])
a.name.return_value = "busy"
failed = self.wvm(a, b).refresh_iso_pools()
self.assertEqual(list(failed), ["busy"])
self.assertIsInstance(failed["busy"], libvirtError)
b.refresh.assert_called_once_with(0)
if __name__ == "__main__":
unittest.main()