1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

show socket error & check with is True

This commit is contained in:
catborise 2020-05-19 14:47:21 +03:00
parent 3f09104980
commit 75d6b33c26
2 changed files with 3 additions and 3 deletions

View file

@ -148,7 +148,7 @@ def overview(request, compute_id):
error_messages = [] error_messages = []
compute = get_object_or_404(Compute, pk=compute_id) 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: try:
conn = wvmHostDetails(compute.hostname, conn = wvmHostDetails(compute.hostname,

View file

@ -326,8 +326,8 @@ class wvmConnectionManager(object):
socket_host.connect('/var/run/libvirt/libvirt-sock') socket_host.connect('/var/run/libvirt/libvirt-sock')
socket_host.close() socket_host.close()
return True return True
except Exception: except Exception as err:
return False return err
connection_manager = wvmConnectionManager( connection_manager = wvmConnectionManager(