'Find canditate subnets for the network, host, and service_type'

def _find_candidate_subnets(self, context, network_id, host, service_type, fixed_configured):

    query = self._query_subnets_on_network(context, network_id)
    query = self._query_filter_service_subnets(query, service_type)
    if (not self.is_host_set(host)):
        if fixed_configured:
            return query.all()
        return self._query_exclude_subnets_on_segments(query).all()
    results = self._query_filter_by_segment_host_mapping(query, host).all()
    segment_ids = {subnet.segment_id for (subnet, mapping) in results if mapping}
    if (1 < len(segment_ids)):
        raise segment_exc.HostConnectedToMultipleSegments(host=host, network_id=network_id)
    return [subnet for (subnet, _mapping) in results]
