Skip to content
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

Auto detect mongo & pymongo version (replaces -M) #161

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hdeheer
Copy link
Contributor

@hdeheer hdeheer commented Jun 25, 2015

  • use version info from server_info() instead of -M
  • update/update_one should be based on pymongo version
  • improve checks based on MongoDB version / storageEngine in use

hdeheer added 2 commits June 25, 2015 11:51
- use version info from server_info() instead of -M
- update/update_one should be based on pymongo version
- improve checks based on MongoDB version / storageEngine in use

Change-Id: Iecc6b2c2b80e3854811c14a74e3f983ad6d63de6
Change-Id: Ibd691ef5d0055739a653413324cf9d67ae4b76f2
@mzupan
Copy link
Owner

mzupan commented Jun 25, 2015

thanks for the PR.. let me test this a bit and I'll merge it

@hdeheer
Copy link
Contributor Author

hdeheer commented Jun 26, 2015

You're welcome.
Let me know if anything is not working out or missing and I'll fix it.

Regards,
Hubert

On 25 Jun 2015, at 17:54, Mike Zupan [email protected] wrote:

thanks for the PR.. let me test this a bit and I'll merge it


Reply to this email directly or view it on GitHub.

Align mongo_connect with supported options depending the pymongo driver
in use. Fixes the 'collections' check on replicasets

Change-Id: I134ef4b494229b462d3c441715aae69339c793b2
Change-Id: I6e9f15897e8c078f010e24f790b96aeeec9f8b16
@warrenpnz
Copy link
Contributor

Alternatively, just update the mongo_version var after making the initial connection:

#
# moving the login up here and passing in the connection
#
start = time.time()
err, con = mongo_connect(host, port, ssl, user, passwd, replicaset)
if err != 0:
    return err
# Grab the MongoDB server version to pass to the different functions
mongo_version = con.server_info()['version'].split('.')[0].strip()

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.

3 participants