mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-10-26 08:55:13 +03:00
diskbackend: Handle unexpected error from test_urls
This commit is contained in:
parent
2df7a6bab4
commit
6a1b0254bf
@ -27,7 +27,12 @@ def _lookup_vol_by_path(conn, path):
|
||||
vol.info()
|
||||
return vol, None
|
||||
except libvirt.libvirtError as e:
|
||||
if (hasattr(libvirt, "VIR_ERR_NO_STORAGE_VOL") and
|
||||
# test_urls trigger empty errors here, because python
|
||||
# garbage collection kicks in after the failure but before
|
||||
# we read the error code, and libvirt virStoragePoolFree
|
||||
# public entry point clears the cached error. So ignore
|
||||
# an empty error code
|
||||
if (e.get_error_code() and
|
||||
e.get_error_code() != libvirt.VIR_ERR_NO_STORAGE_VOL):
|
||||
raise
|
||||
return None, e
|
||||
|
Loading…
Reference in New Issue
Block a user