mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 15:16:41 +00:00
fix storage server to handle the case that it has no directory at all when someone asks for buckets
This commit is contained in:
parent
826ce43be7
commit
1a20e5d01b
@ -116,7 +116,12 @@ class StorageServer(service.MultiService, Referenceable):
|
|||||||
def remote_get_buckets(self, verifierid):
|
def remote_get_buckets(self, verifierid):
|
||||||
bucketreaders = {} # k: sharenum, v: BucketReader
|
bucketreaders = {} # k: sharenum, v: BucketReader
|
||||||
verifierdir = os.path.join(self.storedir, idlib.b2a(verifierid))
|
verifierdir = os.path.join(self.storedir, idlib.b2a(verifierid))
|
||||||
for f in os.listdir(verifierdir):
|
try:
|
||||||
_assert(NUM_RE.match(f), f)
|
for f in os.listdir(verifierdir):
|
||||||
bucketreaders[int(f)] = BucketReader(os.path.join(verifierdir, f))
|
_assert(NUM_RE.match(f), f)
|
||||||
|
bucketreaders[int(f)] = BucketReader(os.path.join(verifierdir, f))
|
||||||
|
except OSError:
|
||||||
|
# Commonly caused by there being no buckets at all.
|
||||||
|
pass
|
||||||
|
|
||||||
return bucketreaders
|
return bucketreaders
|
||||||
|
Loading…
Reference in New Issue
Block a user