From a237e151cc83edc9d3cd2b3ee0df854e7d4b6204 Mon Sep 17 00:00:00 2001 From: drebs Date: Wed, 5 Dec 2012 16:54:07 -0200 Subject: OpenStack backend can sync. --- src/leap/soledad/openstack.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.2.3