Skip to content

Commit

Permalink
Support password for redis+socket://. Closes #460
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Apr 17, 2015
1 parent e1e5797 commit d720d33
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kombu/transport/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,11 +782,12 @@ def _connparams(self):
'socket_timeout': self.socket_timeout}
host = connparams['host']
if '://' in host:
scheme, _, _, _, _, path, query = _parse_url(host)
scheme, _, _, _, password, path, query = _parse_url(host)
if scheme == 'socket':
connparams.update({
'connection_class': redis.UnixDomainSocketConnection,
'path': '/' + path}, **query)
'path': '/' + path,
'password': password}, **query)
connparams.pop('host', None)
connparams.pop('port', None)
connparams['db'] = self._prepare_virtual_host(
Expand All @@ -796,7 +797,7 @@ def _connparams(self):
connection_cls = (
connparams.get('connection_class') or
redis.Connection
)
)

class Connection(connection_cls):
def disconnect(self):
Expand Down

0 comments on commit d720d33

Please sign in to comment.