summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2012-12-05 15:57:14 -0200
committerdrebs <drebs@leap.se>2012-12-05 15:57:14 -0200
commite60d2f46a5372a0a6d0d468a919eefde40d4807a (patch)
tree0c667422ac8eb44f1c78df0487d23bcfddc1079c /src
parent7d12e18de3224ba6ab21713a45b3620537f0d0cc (diff)
OpenStack backend can get all docs
Diffstat (limited to 'src')
-rw-r--r--src/leap/soledad/openstack.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/leap/soledad/openstack.py b/src/leap/soledad/openstack.py
index 31f59e10..ebb97ac5 100644
--- a/src/leap/soledad/openstack.py
+++ b/src/leap/soledad/openstack.py
@@ -55,7 +55,16 @@ class OpenStackDatabase(CommonBackend):
def get_all_docs(self, include_deleted=False):
"""Get all documents from the database."""
- raise NotImplementedError(self.get_all_docs)
+ generation = self._get_generation()
+ results = []
+ _, doc_ids = self._connection.get_container(self._container,
+ full_listing=True)
+ for doc_id in doc_ids:
+ doc = self._get_doc(doc_id)
+ if doc.content is None and not include_deleted:
+ continue
+ results.append(doc)
+ return (generation, results)
def put_doc(self, doc):
if doc.doc_id is None: