Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup: Missing types and variables shadowing #410

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions vm_supervisor/vm/firecracker/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import dataclasses
import logging
import os.path
from asyncio import StreamReader, StreamWriter
from dataclasses import dataclass, field
from enum import Enum
from pathlib import Path
Expand Down Expand Up @@ -439,17 +440,19 @@ async def run_code(
logger.debug("running code")
scope = scope or {}

async def communicate(reader, writer, scope) -> bytes:
payload = RunCodePayload(scope=scope)
async def communicate(
reader_: StreamReader, writer_: StreamWriter, scope_: dict
) -> bytes:
payload = RunCodePayload(scope=scope_)

writer.write(b"CONNECT 52\n" + payload.as_msgpack())
await writer.drain()
writer_.write(b"CONNECT 52\n" + payload.as_msgpack())
await writer_.drain()

ack: bytes = await reader.readline()
ack: bytes = await reader_.readline()
logger.debug(f"ack={ack.decode()}")

logger.debug("waiting for VM response")
response: bytes = await reader.read()
response: bytes = await reader_.read()

return response

Expand Down