From a1dbf59ed9e6714d2424c0e409101ed6bc978c74 Mon Sep 17 00:00:00 2001 From: John Sutherland Date: Mon, 9 Sep 2024 20:13:23 -0700 Subject: [PATCH 1/2] Fix sentinel connections When passing args to Redis(), using the connection_kwargs args allows us to use authentication and other connection features. --- redis/sentinel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redis/sentinel.py b/redis/sentinel.py index 72b5bef548..44a26dda53 100644 --- a/redis/sentinel.py +++ b/redis/sentinel.py @@ -240,7 +240,7 @@ def __init__( self.sentinel_kwargs = sentinel_kwargs self.sentinels = [ - Redis(hostname, port, **self.sentinel_kwargs) + Redis(hostname, port, **connection_kwargs) for hostname, port in sentinels ] self.min_other_sentinels = min_other_sentinels From 751448d6961868b21f66a7deef394691f4bac6ef Mon Sep 17 00:00:00 2001 From: John Sutherland Date: Mon, 9 Sep 2024 21:08:32 -0700 Subject: [PATCH 2/2] Update CHANGES --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index 8750128b05..52d5eed9ae 100644 --- a/CHANGES +++ b/CHANGES @@ -67,6 +67,7 @@ * Close Unix sockets if the connection attempt fails. This prevents `ResourceWarning`s. (#3314) * Close SSL sockets if the connection attempt fails, or if validations fail. (#3317) * Eliminate mutable default arguments in the `redis.commands.core.Script` class. (#3332) + * Fix passing arguments to Redis() when forming Sentinel connections. * 4.1.3 (Feb 8, 2022) * Fix flushdb and flushall (#1926)