summaryrefslogtreecommitdiff
path: root/src/leap/soledad
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2012-12-05 17:10:18 -0200
committerdrebs <drebs@leap.se>2012-12-05 17:10:18 -0200
commit2cf00360bce0193d8fa73194a148c28426172043 (patch)
tree5e358929e434a70df5b73d573f510c583731e26d /src/leap/soledad
parent1815c078a9bb4c016b354429f7618da664344236 (diff)
Methods for OpenStack SyncTarget and typ0.
Diffstat (limited to 'src/leap/soledad')
-rw-r--r--src/leap/soledad/openstack.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/leap/soledad/openstack.py b/src/leap/soledad/openstack.py
index 07ed071d..2c27beb3 100644
--- a/src/leap/soledad/openstack.py
+++ b/src/leap/soledad/openstack.py
@@ -46,7 +46,7 @@ class OpenStackDatabase(CommonBackend):
response, contents = self._connection.get_object(self._container, doc_id)
rev = response['x-object-meta-rev']
return self._factory(doc_id, rev, contents)
- except: swiftclient.ClientException
+ except swiftclient.ClientException:
return None
def get_doc(self, doc_id, include_deleted=False):
@@ -229,11 +229,20 @@ class OpenStackDatabase(CommonBackend):
class OpenStackSyncTarget(HTTPSyncTarget):
def get_sync_info(self, source_replica_uid):
- raise NotImplementedError(self.get_sync_info)
+ source_gen, source_trans_id = self._db._get_replica_gen_and_trans_id(
+ source_replica_uid)
+ my_gen, my_trans_id = self._db._get_generation_info()
+ return (
+ self._db._replica_uid, my_gen, my_trans_id, source_gen,
+ source_trans_id)
def record_sync_info(self, source_replica_uid, source_replica_generation,
source_replica_transaction_id):
- raise NotImplementedError(self.record_sync_info)
+ if self._trace_hook:
+ self._trace_hook('record_sync_info')
+ self._db._set_replica_gen_and_trans_id(
+ source_replica_uid, source_replica_generation,
+ source_replica_transaction_id)
class SimpleLog(object):