From 17545618c79478a104ca7be5dd601020f8749780 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Tue, 3 Nov 2015 19:38:23 +0100 Subject: [feat] update leap.mx usage of soledad CouchDatabase - Related: #7565 --- src/leap/mx/couchdbhelper.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/leap/mx/couchdbhelper.py') diff --git a/src/leap/mx/couchdbhelper.py b/src/leap/mx/couchdbhelper.py index b26a0d8..115ecbe 100644 --- a/src/leap/mx/couchdbhelper.py +++ b/src/leap/mx/couchdbhelper.py @@ -52,10 +52,10 @@ class ConnectedCouchDB(client.CouchDB): :param str password: (optional) The password for authorization. :type password: str """ - self.mail_couch_url = "http://%s:%s@%s:%s" % (username, - password, - host, - port) + self._mail_couch_url = "http://%s:%s@%s:%s" % (username, + password, + host, + port) client.CouchDB.__init__(self, host, port=port, @@ -156,8 +156,9 @@ class ConnectedCouchDB(client.CouchDB): which fails with CouchDBError if there was any error. """ # TODO: that should be implemented with paisley + url = self._mail_couch_url + "/user-%s" % (uuid,) try: - db = CouchDatabase(self._mail_couch_url, "user-%s" % (uuid,)) + db = CouchDatabase.open_database(url, create=False) return defer.succeed(db.put_doc(doc)) except Exception as e: return defer.fail(CouchDBError(e.message)) -- cgit v1.2.3