def hosts_to_endpoints(hosts, port=2181):
    """
    return a list of (host, port) tuples from a given host[:port],... str
    """
    endpoints = []
    for host in hosts.split(','):
        endpoints.append(tuple(host.rsplit(':', 1)) if ':' in host else (
            host, port))
    return endpoints
