Don't ignore kwargs for uri style connections
This commit is contained in:
parent
3c7bf50089
commit
c61de6540a
@ -45,12 +45,14 @@ def register_connection(alias, name, host='localhost', port=27017,
|
|||||||
if uri_dict.get('database') is None:
|
if uri_dict.get('database') is None:
|
||||||
raise ConnectionError("If using URI style connection include "\
|
raise ConnectionError("If using URI style connection include "\
|
||||||
"database name in string")
|
"database name in string")
|
||||||
node = uri_dict['nodelist'][0]
|
_connection_settings[alias] = {
|
||||||
host = node[0]
|
'host': host,
|
||||||
port = node[1]
|
'name': uri_dict.get('database'),
|
||||||
name = uri_dict.get('database')
|
'username': uri_dict.get('username'),
|
||||||
username = uri_dict.get('username') or username
|
'password': uri_dict.get('password')
|
||||||
password = uri_dict.get('password') or password
|
}
|
||||||
|
_connection_settings[alias].update(kwargs)
|
||||||
|
return
|
||||||
|
|
||||||
_connection_settings[alias] = {
|
_connection_settings[alias] = {
|
||||||
'name': name,
|
'name': name,
|
||||||
@ -62,7 +64,6 @@ def register_connection(alias, name, host='localhost', port=27017,
|
|||||||
'password': password,
|
'password': password,
|
||||||
'read_preference': read_preference
|
'read_preference': read_preference
|
||||||
}
|
}
|
||||||
|
|
||||||
_connection_settings[alias].update(kwargs)
|
_connection_settings[alias].update(kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user