mirror of
https://github.com/retspen/webvirtcloud
synced 2024-10-31 19:44:16 +00:00
show socket error & check with is True
This commit is contained in:
parent
566a9d446a
commit
11fcb6c0f3
2 changed files with 3 additions and 3 deletions
|
@ -86,7 +86,7 @@ def overview(request, compute_id):
|
|||
|
||||
error_messages = []
|
||||
compute = get_object_or_404(Compute, pk=compute_id)
|
||||
status = 'true' if connection_manager.host_is_up(compute.type, compute.hostname) else 'false'
|
||||
status = 'true' if connection_manager.host_is_up(compute.type, compute.hostname) is True else 'false'
|
||||
|
||||
try:
|
||||
conn = wvmHostDetails(
|
||||
|
|
|
@ -326,8 +326,8 @@ class wvmConnectionManager(object):
|
|||
socket_host.connect('/var/run/libvirt/libvirt-sock')
|
||||
socket_host.close()
|
||||
return True
|
||||
except Exception:
|
||||
return False
|
||||
except Exception as err:
|
||||
return err
|
||||
|
||||
|
||||
connection_manager = wvmConnectionManager(
|
||||
|
|
Loading…
Reference in a new issue