File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,14 @@ def __init__(
302
302
kwargs ["response_callbacks" ] = self .__class__ .RESPONSE_CALLBACKS .copy ()
303
303
self .connection_kwargs = kwargs
304
304
305
- if not startup_nodes :
305
+ if startup_nodes :
306
+ passed_nodes = []
307
+ for node in startup_nodes :
308
+ passed_nodes .append (
309
+ ClusterNode (node .host , node .port , ** self .connection_kwargs )
310
+ )
311
+ startup_nodes = passed_nodes
312
+ else :
306
313
startup_nodes = []
307
314
if host and port :
308
315
startup_nodes .append (ClusterNode (host , port , ** self .connection_kwargs ))
@@ -1063,6 +1070,7 @@ async def initialize(self) -> None:
1063
1070
fully_covered = False
1064
1071
exception = None
1065
1072
for startup_node in self .startup_nodes .values ():
1073
+ tmp_nodes_cache [startup_node .name ] = startup_node
1066
1074
try :
1067
1075
# Make sure cluster mode is enabled on this node
1068
1076
if not (await startup_node .execute_command ("INFO" )).get (
Original file line number Diff line number Diff line change @@ -239,10 +239,18 @@ async def test_startup_nodes(self) -> None:
239
239
240
240
await cluster .close ()
241
241
242
- startup_nodes = [ ClusterNode ("127.0.0.1" , 16379 )]
243
- async with RedisCluster (startup_nodes = startup_nodes ) as rc :
242
+ startup_node = ClusterNode ("127.0.0.1" , 16379 )
243
+ async with RedisCluster (startup_nodes = [ startup_node ], client_name = "test" ) as rc :
244
244
assert await rc .set ("A" , 1 )
245
245
assert await rc .get ("A" ) == b"1"
246
+ assert all (
247
+ [
248
+ name == "test"
249
+ for name in (
250
+ await rc .client_getname (target_nodes = rc .ALL_NODES )
251
+ ).values ()
252
+ ]
253
+ )
246
254
247
255
async def test_empty_startup_nodes (self ) -> None :
248
256
"""
You can’t perform that action at this time.
0 commit comments