mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 05:28:04 +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):
|
||||
bucketreaders = {} # k: sharenum, v: BucketReader
|
||||
verifierdir = os.path.join(self.storedir, idlib.b2a(verifierid))
|
||||
for f in os.listdir(verifierdir):
|
||||
_assert(NUM_RE.match(f), f)
|
||||
bucketreaders[int(f)] = BucketReader(os.path.join(verifierdir, f))
|
||||
try:
|
||||
for f in os.listdir(verifierdir):
|
||||
_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
|
||||
|
Loading…
Reference in New Issue
Block a user