mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-07 10:56:49 +00:00
Match Foolscap behavior for slot_readv of unknown storage index.
This commit is contained in:
parent
6d412a017c
commit
4b62ec082b
@ -1200,7 +1200,13 @@ class _HTTPStorageServer(object):
|
||||
# If shares list is empty, that means list all shares, so we need
|
||||
# to do a query to get that.
|
||||
if not shares:
|
||||
shares = yield mutable_client.list_shares(storage_index)
|
||||
try:
|
||||
shares = yield mutable_client.list_shares(storage_index)
|
||||
except ClientException as e:
|
||||
if e.code == http.NOT_FOUND:
|
||||
shares = set()
|
||||
else:
|
||||
raise
|
||||
|
||||
# Start all the queries in parallel:
|
||||
for share_number in shares:
|
||||
|
@ -854,6 +854,22 @@ class IStorageServerMutableAPIsTestsMixin(object):
|
||||
{0: [b"abcdefg"], 1: [b"0123456"], 2: [b"9876543"]},
|
||||
)
|
||||
|
||||
@inlineCallbacks
|
||||
def test_slot_readv_unknown_storage_index(self):
|
||||
"""
|
||||
With unknown storage index, ``IStorageServer.slot_readv()`` TODO.
|
||||
"""
|
||||
storage_index = new_storage_index()
|
||||
reads = yield self.storage_client.slot_readv(
|
||||
storage_index,
|
||||
shares=[],
|
||||
readv=[(0, 7)],
|
||||
)
|
||||
self.assertEqual(
|
||||
reads,
|
||||
{},
|
||||
)
|
||||
|
||||
@inlineCallbacks
|
||||
def create_slot(self):
|
||||
"""Create a slot with sharenum 0."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user