Skip to content

Commit

Permalink
update to use new API
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Rempel <[email protected]>
  • Loading branch information
Nicholas Rempel committed May 8, 2020
1 parent de7838a commit d53fb6f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions demo/runners/support/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,10 @@ async def create_and_publish_revocation_registry(

# if PUBLIC_TAILS_URL is specified, upload tails file to tails server
if os.getenv("PUBLIC_TAILS_URL"):
b64_genesis = base64.b64encode(str.encode((await default_genesis_txns())))
tails_server_hash = await self.admin_PUT_FILE(
tails_file,
{"genesis": await default_genesis_txns(), "tails": tails_file},
tails_file_url,
params=None,
headers={"X-Genesis-Transactions": b64_genesis.decode("utf-8")}
)
assert my_tails_hash == tails_server_hash.decode("utf-8")
log_msg(f"Public tails file URL: {tails_file_url}")
Expand Down Expand Up @@ -545,11 +543,11 @@ async def admin_GET_FILE(self, path, params=None) -> bytes:
self.log(f"Error during GET FILE {path}: {str(e)}")
raise

async def admin_PUT_FILE(self, file, url, params=None, headers=None) -> bytes:
async def admin_PUT_FILE(self, files, url, params=None, headers=None) -> bytes:
try:
params = {k: v for (k, v) in (params or {}).items() if v is not None}
resp = await self.client_session.request(
"PUT", url, params=params, data=file, headers=headers
"PUT", url, params=params, data=files, headers=headers
)
resp.raise_for_status()
return await resp.read()
Expand Down

0 comments on commit d53fb6f

Please sign in to comment.