if len(hostips) > 1:
logger.warning("More than one IPv4 address found. Using %s.", hostip)
- if hostip6 is None:
- try:
- logger.info("Looking up IPv6 address for %s" % names.hostname)
- for ip in socket.getaddrinfo(names.hostname, None, socket.AF_INET6, socket.AI_CANONNAME, socket.IPPROTO_IP):
- if hostip6 is None:
- hostip6 = ip[-1][0]
- if hostip6 == '::1' and ip[-1][0] != '::1':
- hostip6 = ip[-1][0]
- except socket.gaierror, (socket.EAI_NODATA, msg):
- hostip6 = None
-
if serverrole is None:
serverrole = lp.get("server role")