Skip to content
Snippets Groups Projects
Commit 604eb306 authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

pull uri construction out to ease reuse

parent f87ceae7
Branches
Tags
1 merge request!309Add a Tahoe-LAFS replica snapshot downloader
......@@ -88,8 +88,9 @@ async def upload(
:raise: If there is a problem uploading the data -- except for
unavailability of storage servers -- then some exception is raised.
"""
uri = api_root.child("uri")
with inpath.open() as f:
resp = await client.put(api_root.child("uri"), f)
resp = await client.put(uri, f)
content = (await treq.content(resp)).decode("utf-8")
if resp.code in (200, 201):
return content
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment