Skip to content

Fix connecting to a list of hosts #1389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2016

Conversation

jtharpla
Copy link
Contributor

Fixes a regression caused by #1151 where host can no longer be a list when calling connect() as this triggers the following error:

    mongoengine/connection.py line 61 in register_connection
      if conn_host.startswith('mongomock://'):
   AttributeError: 'list' object has no attribute 'startswith'

Adds a new unit test to cover this possibility and follows the same approach used by pymongo.MongoClient, which is designed to accept host as either a list or a string.

@lafrech lafrech merged commit 6767b50 into MongoEngine:master Oct 19, 2016
@lafrech
Copy link
Member

lafrech commented Oct 19, 2016

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants