summaryrefslogtreecommitdiff
path: root/openstack.py
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
commitc596c469502004432783a210938c8c8ce5ae75a8 (patch)
tree38d68b4e5dd50c40a7e6146d722f90adccc80039 /openstack.py
parent5c2426df451b80ddea03a651614100ebacf118b0 (diff)
OpenStack backend can sync.
Diffstat (limited to 'openstack.py')
-rw-r--r--openstack.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/openstack.py b/openstack.py
index e7d62751..af04465d 100644
--- a/openstack.py
+++ b/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)