File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 19
19
import socket
20
20
import warnings
21
21
from cassandra import WriteType as WT
22
+ from cassandra .connection import UnixSocketEndPoint
22
23
23
24
24
25
# This is done this way because WriteType was originally
@@ -422,8 +423,13 @@ def __init__(self, hosts):
422
423
connections to.
423
424
"""
424
425
self ._allowed_hosts = tuple (hosts )
425
- self ._allowed_hosts_resolved = [endpoint [4 ][0 ] for a in self ._allowed_hosts
426
- for endpoint in socket .getaddrinfo (a , None , socket .AF_UNSPEC , socket .SOCK_STREAM )]
426
+ self ._allowed_hosts_resolved = []
427
+ for h in self ._allowed_hosts :
428
+ if isinstance (h , UnixSocketEndPoint ):
429
+ self ._allowed_hosts_resolved .append (h ._unix_socket_path )
430
+ else :
431
+ self ._allowed_hosts_resolved .extend ([endpoint [4 ][0 ]
432
+ for endpoint in socket .getaddrinfo (h , None , socket .AF_UNSPEC , socket .SOCK_STREAM )])
427
433
428
434
RoundRobinPolicy .__init__ (self )
429
435
You can’t perform that action at this time.
0 commit comments