hmarr/mongoengine — Issue #378: PyMongo 2.0+ has changed connection string validation
Author: Amorano
Created: 2011-12-02 02:29:06+00:00
State: open

#1) slave_okay is deprecated -- use the newer read_preferences (for 2.0+ greater)

#2) the conn_settings dict is being passed to PyMongo as valid connection string parameters. PyMongo doesn't seem to parse those like it used to.

Changing mongoengine/connection.py line 77 [ conn_settings['slaves'] = slaves ] to:

conn_settings['slaves'] = slaves
conn_settings.pop('name')
conn_settings.pop('slaves')
conn_settings.pop('is_slave')
conn_settings.pop('username')
conn_settings.pop('password')

clears the paramter stack for the connection and it validates and creates a proper connection via pymongo.