diff --git a/src/aleph/vm/controllers/firecracker/program.py b/src/aleph/vm/controllers/firecracker/program.py index 2bc060200..6b7436899 100644 --- a/src/aleph/vm/controllers/firecracker/program.py +++ b/src/aleph/vm/controllers/firecracker/program.py @@ -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() @@ -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] @@ -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") diff --git a/src/aleph/vm/controllers/qemu/instance.py b/src/aleph/vm/controllers/qemu/instance.py index a8b9cde4e..d0d341c91 100644 --- a/src/aleph/vm/controllers/qemu/instance.py +++ b/src/aleph/vm/controllers/qemu/instance.py @@ -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 diff --git a/src/aleph/vm/orchestrator/views/authentication.py b/src/aleph/vm/orchestrator/views/authentication.py index f1acb2f01..84dd96982 100644 --- a/src/aleph/vm/orchestrator/views/authentication.py +++ b/src/aleph/vm/orchestrator/views/authentication.py @@ -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) @@ -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"]