'Prepare the given query on all hosts, excluding ``excluded_host``.
Intended for internal use only.'

def prepare_on_all_hosts(self, query, excluded_host):

    futures = []
    for host in tuple(self._pools.keys()):
        if ((host != excluded_host) and host.is_up):
            future = ResponseFuture(self, PrepareMessage(query=query), None, self.default_timeout)
            try:
                request_id = future._query(host)
            except Exception:
                log.exception('Error    preparing    query    for    host    %s:', host)
                continue
            if (request_id is None):
                log.debug('Failed    to    prepare    query    for    host    %s:    %r', host, future._errors.get(host))
                continue
            futures.append((host, future))
    for (host, future) in futures:
        try:
            future.result()
        except Exception:
            log.exception('Error    preparing    query    for    host    %s:', host)
