[mod] add debugging code to avoid becoming mad when things goes wrong

This commit is contained in:
Laurent Peuch 2017-01-08 05:31:11 +01:00
parent 047026df6c
commit d665984789

View file

@ -820,9 +820,11 @@ def _domain_is_accessible_through_HTTP(ip, domain):
def _domain_is_resolved_locally(public_ip, domain): def _domain_is_resolved_locally(public_ip, domain):
try: try:
ip = socket.gethostbyname(domain) ip = socket.gethostbyname(domain)
except socket.error: except socket.error as e:
logger.debug("Couldn't get domain '%s' ip because: %s" % (domain, e))
return False return False
logger.debug("Domain '%s' ip is %s, except it to be 127.0.0.1 or %s" % (domain, public_ip))
return ip in ["127.0.0.1", public_ip] return ip in ["127.0.0.1", public_ip]