Redis: Fix missing ssl/auth options for sentinel
This ensures options for redis connections are replicated to sentinel clients, so that users can enable SSL or authentication in Redis sentinel while they also enable these in Redis. Closes-Bug: #2052372 Change-Id: I78727387cf8287554549ff5a99a80f3317cbd59b
This commit is contained in:
parent
2c0d37c2e5
commit
4954e284b9
@ -0,0 +1,7 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The redis coordination driver now applies the connection arguments to Redis
|
||||
sentinel. This allows enabling SSL or authentication in Redis Sentinel.
|
||||
Note that using different SSL certificates or different credentials is not
|
||||
supported now.
|
@ -53,7 +53,7 @@ etcd3gw =
|
||||
zake =
|
||||
zake>=0.1.6 # Apache-2.0
|
||||
redis =
|
||||
redis>=3.4.0 # MIT
|
||||
redis>=4.0.0 # MIT
|
||||
postgresql =
|
||||
psycopg2>=2.5 # LGPL/ZPL
|
||||
mysql =
|
||||
|
@ -468,17 +468,15 @@ return 1
|
||||
if 'sentinel' in kwargs:
|
||||
sentinel_hosts = [
|
||||
cls._parse_sentinel(fallback)
|
||||
for fallback in kwargs.get('sentinel_fallback', [])
|
||||
for fallback in kwargs.pop('sentinel_fallback', [])
|
||||
]
|
||||
sentinel_hosts.insert(0, (kwargs['host'], kwargs['port']))
|
||||
sentinel_name = kwargs.pop('sentinel')
|
||||
sentinel_server = sentinel.Sentinel(
|
||||
sentinel_hosts,
|
||||
socket_timeout=kwargs['socket_timeout'])
|
||||
sentinel_name = kwargs['sentinel']
|
||||
del kwargs['sentinel']
|
||||
if 'sentinel_fallback' in kwargs:
|
||||
del kwargs['sentinel_fallback']
|
||||
master_client = sentinel_server.master_for(sentinel_name, **kwargs)
|
||||
sentinel_kwargs=kwargs,
|
||||
**kwargs)
|
||||
master_client = sentinel_server.master_for(sentinel_name)
|
||||
# The master_client is a redis.Redis using a
|
||||
# Sentinel managed connection pool.
|
||||
return master_client
|
||||
|
Loading…
Reference in New Issue
Block a user