Fix broken redis sentinel support

This fixes the regression caused by [1] and ensures host and port are
removed from kwargs, to avoid conflict with underlying usages.

This also makes the current implementation consistent with taskflow.

[1] 4954e284b9

Closes-Bug: #2056429
Change-Id: Iaa5f09e8dcfff9e65853f6f89976cf4c025bc864
This commit is contained in:
Takashi Kajinami 2024-03-07 17:25:57 +09:00
parent 1d0ece27a4
commit 94d299c777
1 changed files with 3 additions and 1 deletions

View File

@ -472,7 +472,9 @@ return 1
cls._parse_sentinel(fallback)
for fallback in kwargs.pop('sentinel_fallback', [])
]
sentinel_hosts.insert(0, (kwargs['host'], kwargs['port']))
sentinel_hosts.insert(0, (kwargs.pop('host'), kwargs.pop('port')))
for fallback in kwargs.pop('sentinel_fallback', []):
sentinel_hosts.append(cls._parse_sentinel(fallback))
sentinel_name = kwargs.pop('sentinel')
sentinel_server = sentinel.Sentinel(
sentinel_hosts,