Skip to content

Commit 5035a58

Browse files
author
Rebecka Gulliksson
committed
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.
1 parent da91d08 commit 5035a58

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def run_tests(self):
3737
tests_require = [
3838
'mongodict',
3939
'pyasn1',
40-
'pymongo',
40+
'pymongo==3.0.1',
4141
'python-memcached == 1.51',
4242
'pytest',
4343
'mako',

src/saml2/mdbcache.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/usr/bin/env python
22
import logging
3+
from pymongo.mongo_client import MongoClient
34

45
__author__ = 'rolandh'
56

6-
from pymongo import Connection
77
#import cjson
88
import time
99
from datetime import datetime
@@ -18,9 +18,9 @@
1818
class Cache(object):
1919
def __init__(self, server=None, debug=0, db=None):
2020
if server:
21-
connection = Connection(server)
21+
connection = MongoClient(server)
2222
else:
23-
connection = Connection()
23+
connection = MongoClient()
2424

2525
if db:
2626
self._db = connection[db]

0 commit comments

Comments
 (0)