Compare commits

...

1 Commits

Author SHA1 Message Date
Stefan Agner
fd370f3fa5 Fix type annotations in RAUC D-Bus interface
Replace ctypes (c_uint32, c_uint64) with native Python int types in
SlotStatusDataType. The dbus-fast library returns Python int objects
for D-Bus uint32/uint64 types, making ctypes unnecessary and improving
type correctness.

Also correct mark() return type from tuple[str, str] to list[str] to
match the actual D-Bus return value structure.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-04 11:35:43 +01:00

View File

@@ -1,6 +1,5 @@
"""D-Bus interface for rauc."""
from ctypes import c_uint32, c_uint64
import logging
from typing import Any, NotRequired, TypedDict
@@ -34,12 +33,12 @@ SlotStatusDataType = TypedDict(
"device": str,
"bundle.compatible": NotRequired[str],
"sha256": NotRequired[str],
"size": NotRequired[c_uint64],
"installed.count": NotRequired[c_uint32],
"size": NotRequired[int],
"installed.count": NotRequired[int],
"bundle.version": NotRequired[str],
"installed.timestamp": NotRequired[str],
"status": NotRequired[str],
"activated.count": NotRequired[c_uint32],
"activated.count": NotRequired[int],
"activated.timestamp": NotRequired[str],
"boot-status": NotRequired[str],
"bootname": NotRequired[str],
@@ -117,7 +116,7 @@ class Rauc(DBusInterfaceProxy):
return self.connected_dbus.signal(DBUS_SIGNAL_RAUC_INSTALLER_COMPLETED)
@dbus_connected
async def mark(self, state: RaucState, slot_identifier: str) -> tuple[str, str]:
async def mark(self, state: RaucState, slot_identifier: str) -> list[str]:
"""Get slot status."""
return await self.connected_dbus.Installer.call("mark", state, slot_identifier)