mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-09 19:56:48 +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:
parent
d5d054de71
commit
b89672169f
5 changed files with 29 additions and 7 deletions
|
|
@ -1715,10 +1715,15 @@ class wvmInstance(wvmConnect):
|
|||
|
||||
def refresh_iso_pools(self):
|
||||
"""Refresh the active pools, so that an image copied to one by hand
|
||||
is listed by get_iso_media."""
|
||||
is listed by get_iso_media. A pool that fails does not stop the
|
||||
others; returns the errors, by pool name."""
|
||||
failed = {}
|
||||
for pool in self.wvm.listAllStoragePools(VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE):
|
||||
with contextlib.suppress(libvirtError): # stopped or removed meanwhile
|
||||
try:
|
||||
pool.refresh(0)
|
||||
except libvirtError as err:
|
||||
failed[pool.name()] = err
|
||||
return failed
|
||||
|
||||
def get_iso_media(self):
|
||||
"""The .iso volumes libvirt knows in the active pools; one copied in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue