~ubuntu-branches/ubuntu/wily/python-pysaml2/wily-proposed

« back to all changes in this revision

Viewing changes to src/saml2/mdbcache.py

  • Committer: Package Import Robot
  • Author(s): Łukasz 'sil2100' Zemczak
  • Date: 2015-10-08 20:16:42 UTC
  • Revision ID: package-import@ubuntu.com-20151008201642-hm7czi1dygbmgell
Tags: 2.4.0-0ubuntu2
* debian/control:
  - Depend on python-pymongo versions 3.0 and higher
* debian/patches/fix-build-against-new-pymongo.patch:
  - Cherry-pick fix pysaml2 with python-pymongo 3.0
* debian/patches/fix-test-failures.patch:
  - Fix the newly failing test failures (LP: #1503698)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
2
import logging
 
3
from pymongo.mongo_client import MongoClient
3
4
 
4
5
__author__ = 'rolandh'
5
6
 
6
 
from pymongo import Connection
7
7
#import cjson
8
8
import time
9
9
from datetime import datetime
18
18
class Cache(object):
19
19
    def __init__(self, server=None, debug=0, db=None):
20
20
        if server:
21
 
            connection = Connection(server)
 
21
            connection = MongoClient(server)
22
22
        else:
23
 
            connection = Connection()
 
23
            connection = MongoClient()
24
24
 
25
25
        if db:
26
26
            self._db = connection[db]