redis: Add username
Redis introduced ACL feature in 4.0.0, and this feature is supported by
redis-py since 3.4.0[1]. When ACL is enabled, authentication requires
username in addition to password.
[1] 8df8cd54d1
Change-Id: I9b53c3a314dcffbe49535799ba6d7a1fdddb8d84
This commit is contained in:
parent
22361cb48d
commit
886323cc05
|
@ -53,7 +53,7 @@ etcd3gw =
|
||||||
zake =
|
zake =
|
||||||
zake>=0.1.6 # Apache-2.0
|
zake>=0.1.6 # Apache-2.0
|
||||||
redis =
|
redis =
|
||||||
redis>=3.1.0 # MIT
|
redis>=3.4.0 # MIT
|
||||||
postgresql =
|
postgresql =
|
||||||
psycopg2>=2.5 # LGPL/ZPL
|
psycopg2>=2.5 # LGPL/ZPL
|
||||||
mysql =
|
mysql =
|
||||||
|
|
|
@ -159,7 +159,8 @@ class RedisDriver(coordination.CoordinationDriverCachedRunWatchers,
|
||||||
|
|
||||||
The Redis driver connection URI should look like::
|
The Redis driver connection URI should look like::
|
||||||
|
|
||||||
redis://[:PASSWORD@]HOST:PORT[?OPTION=VALUE[&OPTION2=VALUE2[&...]]]
|
redis://[USERNAME:PASSWORD@]HOST:PORT
|
||||||
|
[?OPTION=VALUE[&OPTION2=VALUE2[&...]]]
|
||||||
|
|
||||||
For a list of options recognized by this driver, see the documentation
|
For a list of options recognized by this driver, see the documentation
|
||||||
for the member CLIENT_ARGS, and to determine the expected types of those
|
for the member CLIENT_ARGS, and to determine the expected types of those
|
||||||
|
@ -428,6 +429,8 @@ return 1
|
||||||
if not parsed_url.path:
|
if not parsed_url.path:
|
||||||
raise ValueError("Expected socket path in parsed urls path")
|
raise ValueError("Expected socket path in parsed urls path")
|
||||||
kwargs['unix_socket_path'] = parsed_url.path
|
kwargs['unix_socket_path'] = parsed_url.path
|
||||||
|
if parsed_url.username:
|
||||||
|
kwargs['username'] = parsed_url.username
|
||||||
if parsed_url.password:
|
if parsed_url.password:
|
||||||
kwargs['password'] = parsed_url.password
|
kwargs['password'] = parsed_url.password
|
||||||
for a in cls.CLIENT_ARGS:
|
for a in cls.CLIENT_ARGS:
|
||||||
|
|
Loading…
Reference in New Issue