Skip to content

Commit

Permalink
Fix typing: Missing annotation on methods
Browse files Browse the repository at this point in the history
  • Loading branch information
hoh committed Apr 9, 2024
1 parent 3bfe28d commit d386374
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/aleph/vm/controllers/firecracker/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def __init__(
prepare_jailer,
)

async def setup(self):
async def setup(self) -> None:
logger.debug(f"Setup started for VM={self.vm_id}")
await setfacl()

Expand Down Expand Up @@ -326,7 +326,7 @@ async def wait_for_init(self) -> None:
"""Wait for the custom init inside the virtual machine to signal it is ready."""
await self.fvm.wait_for_init()

async def load_configuration(self):
async def load_configuration(self) -> None:
code: bytes | None
volumes: list[Volume]

Expand All @@ -342,7 +342,7 @@ async def _setup_configuration(
input_data: bytes | None,
interface: Interface,
volumes: list[Volume],
):
) -> None:
"""Set up the VM configuration. The program mode uses a VSOCK connection to the custom init of the virtual
machine to send this configuration. Other modes may use Cloud-init, ..."""
logger.debug("Sending configuration")
Expand Down
2 changes: 1 addition & 1 deletion src/aleph/vm/controllers/qemu/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def make_logs_queue(stdout_identifier, stderr_identifier, skip_past=True) -> tup
r.add_match(SYSLOG_IDENTIFIER=stderr_identifier)
queue: asyncio.Queue = asyncio.Queue(maxsize=1000)

def _ready_for_read():
def _ready_for_read() -> None:
change_type = r.process() # reset fd status
if change_type != journal.APPEND:
return
Expand Down
4 changes: 2 additions & 2 deletions src/aleph/vm/orchestrator/views/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def payload_must_be_hex(cls, v: bytes) -> bytes:
return bytes.fromhex(v.decode())

@root_validator(pre=False, skip_on_failure=True)
def check_expiry(cls, values):
def check_expiry(cls, values) -> dict[str, bytes]:
"""Check that the token has not expired"""
payload: bytes = values["payload"]
content = SignedPubKeyPayload.parse_raw(payload)
Expand All @@ -78,7 +78,7 @@ def check_expiry(cls, values):
return values

@root_validator(pre=False, skip_on_failure=True)
def check_signature(cls, values):
def check_signature(cls, values) -> dict[str, bytes]:
"""Check that the signature is valid"""
signature: bytes = values["signature"]
payload: bytes = values["payload"]
Expand Down

0 comments on commit d386374

Please sign in to comment.