- if service_name not in service_hosts:
- service_hosts[service_name] = set()
- # it's nice to know how many distinct hosts are available for
- # each service. We define a "host" by a set of addresses
- # (hostnames or ipv4 addresses), which we extract from the
- # connection hints. In practice, this is usually close
- # enough: when multiple services are run on a single host,
- # they're usually either configured with the same addresses,
- # or setLocationAutomatically picks up the same interfaces.
- host = frozenset(ad.advertised_addresses)
- service_hosts[service_name].add(host)