Update log messages
This commit is contained in:
parent
76fa87a9a3
commit
46007462d3
@ -18,9 +18,9 @@ def check_connection(remote_host=DEFAULT_REMOTE_HOST) -> bool:
|
|||||||
""" Check internet connection by pinging remote_host """
|
""" Check internet connection by pinging remote_host """
|
||||||
ping_proc = subprocess.run(['ping', '-c', '5', remote_host], capture_output=True)
|
ping_proc = subprocess.run(['ping', '-c', '5', remote_host], capture_output=True)
|
||||||
if ping_proc.stdout:
|
if ping_proc.stdout:
|
||||||
logging.info("Ping stdout:\n%s", ping_proc.stdout.decode().strip())
|
logging.info("ping stdout:\n%s", ping_proc.stdout.decode().strip())
|
||||||
if ping_proc.stderr:
|
if ping_proc.stderr:
|
||||||
logging.info("Ping stderr:\n%s", ping_proc.stderr.decode().strip())
|
logging.info("ping stderr:\n%s", ping_proc.stderr.decode().strip())
|
||||||
return ping_proc.returncode == 0
|
return ping_proc.returncode == 0
|
||||||
|
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ def run_vpn_checks(remote_host=DEFAULT_REMOTE_HOST,
|
|||||||
|
|
||||||
logging.info("Checking internet connection")
|
logging.info("Checking internet connection")
|
||||||
if not check_connection(remote_host=remote_host):
|
if not check_connection(remote_host=remote_host):
|
||||||
logging.warning("Remote host is not pingable")
|
logging.warning("Remote host %s is not available through ICMP", remote_host)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if route_prefix:
|
if route_prefix:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user