summaryrefslogtreecommitdiff
path: root/src/leap/soledad
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2012-12-05 16:54:07 -0200
committerdrebs <drebs@leap.se>2012-12-05 16:54:07 -0200
commita237e151cc83edc9d3cd2b3ee0df854e7d4b6204 (patch)
tree116684a98dd186335bbe74291ade48ef7d52c073 /src/leap/soledad
parent492c3f711927e09acd044db9aa76ce7a05c946c7 (diff)
OpenStack backend can sync.
Diffstat (limited to 'src/leap/soledad')
-rw-r--r--src/leap/soledad/openstack.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/leap/soledad/openstack.py b/src/leap/soledad/openstack.py
index e7d62751..af04465d 100644
--- a/src/leap/soledad/openstack.py
+++ b/src/leap/soledad/openstack.py
@@ -137,7 +137,10 @@ class OpenStackDatabase(CommonBackend):
raise NotImplementedError(self.close)
def sync(self, url, creds=None, autocreate=True):
- raise NotImplementedError(self.close)
+ from u1db.sync import Synchronizer
+ from u1db.remote.http_target import OpenStackSyncTarget
+ return Synchronizer(self, OpenStackSyncTarget(url, creds=creds)).sync(
+ autocreate=autocreate)
def _get_replica_gen_and_trans_id(self, other_replica_uid):
self._get_u1db_data()
@@ -164,7 +167,8 @@ class OpenStackDatabase(CommonBackend):
return self._transaction_log.get_generation_info()
def _has_conflicts(self, doc_id):
- raise NotImplementedError(self._has_conflicts)
+ # Documents never have conflicts on server.
+ return False
def _put_and_update_indexes(self, doc_id, old_doc, new_rev, content):
raise NotImplementedError(self._put_and_update_indexes)