Not sure if per method logging is worth it, will start from assumption that HTTP

logging is enough.
This commit is contained in:
Itamar Turner-Trauring 2023-03-28 12:55:41 -04:00
parent 4211fd8525
commit e8c72e6753

View File

@ -746,22 +746,18 @@ class StorageClientImmutables(object):
"""
Return the set of shares for a given storage index.
"""
with start_action(
action_type="allmydata:storage:http-client:immutable:list-shares",
storage_index=storage_index,
) as ctx:
url = self._client.relative_url(
"/storage/v1/immutable/{}/shares".format(_encode_si(storage_index))
)
response = yield self._client.request(
"GET",
url,
)
if response.code == http.OK:
body = yield self._client.decode_cbor(response, _SCHEMAS["list_shares"])
returnValue(set(body))
else:
raise ClientException(response.code)
url = self._client.relative_url(
"/storage/v1/immutable/{}/shares".format(_encode_si(storage_index))
)
response = yield self._client.request(
"GET",
url,
)
if response.code == http.OK:
body = yield self._client.decode_cbor(response, _SCHEMAS["list_shares"])
returnValue(set(body))
else:
raise ClientException(response.code)
def advise_corrupt_share(
self,