libvirt: fix missing python-libvirt issue
When python-libvirt is missing we must not use libvirt module exception and just reraise error as-is. Change-Id: If000dafdf9b7b08e108f6f91ae6ec967923eeb1d Closes-bug: #1572016
This commit is contained in:
parent
bdb291739a
commit
7d455d536f
@ -47,6 +47,9 @@ def retry_on_disconnect(function):
|
||||
def decorator(self, *args, **kwargs):
|
||||
try:
|
||||
return function(self, *args, **kwargs)
|
||||
except ImportError:
|
||||
# NOTE(sileht): in case of libvirt failed to be imported
|
||||
raise
|
||||
except libvirt.libvirtError as e:
|
||||
if (e.get_error_code() in (libvirt.VIR_ERR_SYSTEM_ERROR,
|
||||
libvirt.VIR_ERR_INTERNAL_ERROR) and
|
||||
|
Loading…
Reference in New Issue
Block a user