def get_network_addresses(self):
        """For each network configured, return corresponding address and
           hostnamr or vip (if available).

        Returns a list of tuples of the form:

            [(address_in_net_a, hostname_in_net_a),
             (address_in_net_b, hostname_in_net_b),
             ...]

            or, if no hostnames(s) available:

            [(address_in_net_a, vip_in_net_a),
             (address_in_net_b, vip_in_net_b),
             ...]

            or, if no vip(s) available:

            [(address_in_net_a, address_in_net_a),
             (address_in_net_b, address_in_net_b),
             ...]
        """
        addresses = []
        for net_type in [INTERNAL, ADMIN, PUBLIC]:
            net_config = config(ADDRESS_MAP[net_type]['config'])
            # NOTE(jamespage): Fallback must always be private address
            #                  as this is used to bind services on the
            #                  local unit.
            fallback = unit_get("private-address")
            if net_config:
                addr = get_address_in_network(net_config,
                                              fallback)
            else:
                try:
                    addr = network_get_primary_address(
                        ADDRESS_MAP[net_type]['binding']
                    )
                except (NotImplementedError, NoNetworkBinding):
                    addr = fallback

            endpoint = resolve_address(net_type)
            addresses.append((addr, endpoint))

        return sorted(set(addresses))
For each network configured, return corresponding address and
           hostnamr or vip (if available).

        Returns a list of tuples of the form:

            [(address_in_net_a, hostname_in_net_a),
             (address_in_net_b, hostname_in_net_b),
             ...]

            or, if no hostnames(s) available:

            [(address_in_net_a, vip_in_net_a),
             (address_in_net_b, vip_in_net_b),
             ...]

            or, if no vip(s) available:

            [(address_in_net_a, address_in_net_a),
             (address_in_net_b, address_in_net_b),
             ...]