1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-10-31 19:44:16 +00:00

add localhost is up checking

This commit is contained in:
catborise 2020-05-19 00:07:46 +03:00 committed by catborise
parent b48b112a40
commit 0c72ccd066

View file

@ -321,10 +321,13 @@ class wvmConnectionManager(object):
socket_host.connect((hostname, TCP_PORT)) socket_host.connect((hostname, TCP_PORT))
if conn_type == CONN_TLS: if conn_type == CONN_TLS:
socket_host.connect((hostname, TLS_PORT)) socket_host.connect((hostname, TLS_PORT))
if conn_type == CONN_SOCKET:
socket_host = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
socket_host.connect('/var/run/libvirt/libvirt-sock')
socket_host.close() socket_host.close()
return True return True
except Exception as err: except Exception:
return err return False
connection_manager = wvmConnectionManager( connection_manager = wvmConnectionManager(