def __init__(self, hosts):
"""
The `hosts` parameter should be a sequence of hosts to permit
connections to.
"""
msg = ('WhiteListRoundRobinPolicy is deprecated. '
'It will be removed in 4.0. '
'It can effectively be reimplemented using HostFilterPolicy.')
warn(msg, DeprecationWarning)
# DeprecationWarnings are silent by default so we also log the message
log.warning(msg)
self._allowed_hosts = hosts
self._allowed_hosts_resolved = [endpoint[4][0] for a in self._allowed_hosts
for endpoint in socket.getaddrinfo(a, None, socket.AF_UNSPEC, socket.SOCK_STREAM)]
RoundRobinPolicy.__init__(self)
评论列表
文章目录