in wadebug/wa_actions/implementations/check_network.py [0:0]
def _run(cls, config, *args, **kwargs):
wacore_containers = docker_utils.get_running_wacore_containers()
if not wacore_containers:
return results.Skipped(
cls,
"Network connectivity check was skipped",
"There is no wacore container running. Action skipped.",
"If this is unexpected, check results from other actions to diagnose. "
"If this is expected (e.g.: an HA/MC setup "
"across multiple hosts is under test), no actions are required.",
)
container = wacore_containers[0]
hosts_not_reachable = get_hosts_not_reachable_from_container(
container, WHATSAPP_SERVERS
)
TROUBLESHOOTING_URL = (
"https://developers.facebook.com/docs/whatsapp/network-debugging"
)
if hosts_not_reachable:
error_message = format_error_message(hosts_not_reachable)
return results.Problem(
cls,
"Network connectivity check fails",
error_message,
"Please refer to {} for network requirements details.".format(
TROUBLESHOOTING_URL
),
)
return results.OK(cls)