diff options
author | Benjamin Saller <bcsaller@objectrealms.net> | 2007-07-22 17:30:59 (GMT) |
---|---|---|
committer | Benjamin Saller <bcsaller@objectrealms.net> | 2007-07-22 17:30:59 (GMT) |
commit | ab19f19116433362051e988a9e5709018f5c4ad0 (patch) | |
tree | 6037b7a121768e08446e0fbb6e5496408b75b820 /src | |
parent | f0bffbf7a8357b6c38ebe09d1b81d7faadca588c (diff) |
fix #2381
the new implementation of xapianindex violated the contract with backingstore here based on what the old index layer did. There is a test now covering this case and the issue is fixed
Diffstat (limited to 'src')
-rw-r--r-- | src/olpc/datastore/backingstore.py | 2 | ||||
-rw-r--r-- | src/olpc/datastore/datastore.py | 15 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/olpc/datastore/backingstore.py b/src/olpc/datastore/backingstore.py index f317983..13ec2ee 100644 --- a/src/olpc/datastore/backingstore.py +++ b/src/olpc/datastore/backingstore.py @@ -488,7 +488,7 @@ class InplaceFileBackingStore(FileBackingStore): def get(self, uid, env=None, allowMissing=False): content = self.indexmanager.get(uid) if not content: raise KeyError(uid) - return content.get_property('filename') + return content def update(self, uid, props, filelike=None): # the file would have already been changed inplace diff --git a/src/olpc/datastore/datastore.py b/src/olpc/datastore/datastore.py index d026fce..111548c 100644 --- a/src/olpc/datastore/datastore.py +++ b/src/olpc/datastore/datastore.py @@ -335,11 +335,20 @@ class DataStore(dbus.service.Object): def get(self, uid): mp = self._resolveMountpoint() - c = mp.get(uid) + c = None + try: + c = mp.get(uid) + if c: return c + except KeyError: + pass + if not c: for mp in self.mountpoints.itervalues(): - c = mp.get(uid) - if c: break + try: + c = mp.get(uid) + if c: break + except KeyError: + continue return c #@utils.sanitize_dbus |