From 5035a58137f7ba5ad79e4e52703b789b2a726955 Mon Sep 17 00:00:00 2001 From: Rebecka Gulliksson Date: Wed, 22 Apr 2015 09:30:25 +0200 Subject: [PATCH] Updated mdbcache to use the new MongoClient class and specific version of pymongo in setup.py. Connection class has been deprecated and was removed in pymongo 3.0. --- setup.py | 2 +- src/saml2/mdbcache.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 616779e..fce3d72 100755 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ install_requires = [ tests_require = [ 'mongodict', 'pyasn1', - 'pymongo', + 'pymongo==3.0.1', 'python-memcached == 1.51', 'pytest', 'mako', diff --git a/src/saml2/mdbcache.py b/src/saml2/mdbcache.py index 86ebd17..0817827 100644 --- a/src/saml2/mdbcache.py +++ b/src/saml2/mdbcache.py @@ -1,9 +1,9 @@ #!/usr/bin/env python import logging +from pymongo.mongo_client import MongoClient __author__ = 'rolandh' -from pymongo import Connection #import cjson import time from datetime import datetime @@ -18,9 +18,9 @@ logger = logging.getLogger(__name__) class Cache(object): def __init__(self, server=None, debug=0, db=None): if server: - connection = Connection(server) + connection = MongoClient(server) else: - connection = Connection() + connection = MongoClient() if db: self._db = connection[db]