diff options
author | Maxim Devaev <[email protected]> | 2023-11-20 07:08:13 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-11-20 07:08:13 +0200 |
commit | 0e42e10c29503d109368542245cdbe6e7ad723c6 (patch) | |
tree | fc8f3d4527c31f83fca90ba3d05f05174b26f4cb | |
parent | 627f7821efbdabf58d748a9bd395545ee1e20b23 (diff) |
lint fix
-rw-r--r-- | kvmd/aiotools.py | 2 | ||||
-rw-r--r-- | kvmd/apps/kvmd/api/export.py | 8 | ||||
-rw-r--r-- | kvmd/apps/kvmd/api/redfish.py | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/kvmd/aiotools.py b/kvmd/aiotools.py index 8449419e..2b148573 100644 --- a/kvmd/aiotools.py +++ b/kvmd/aiotools.py @@ -202,7 +202,7 @@ async def wait_infinite() -> None: await asyncio.sleep(3600) -async def wait_first(*aws: (asyncio.Future | asyncio.Task)) -> tuple[set[asyncio.Task], set[asyncio.Task]]: +async def wait_first(*aws: asyncio.Task) -> tuple[set[asyncio.Task], set[asyncio.Task]]: return (await asyncio.wait(list(aws), return_when=asyncio.FIRST_COMPLETED)) diff --git a/kvmd/apps/kvmd/api/export.py b/kvmd/apps/kvmd/api/export.py index 081e81a2..d2678f1d 100644 --- a/kvmd/apps/kvmd/api/export.py +++ b/kvmd/apps/kvmd/api/export.py @@ -63,16 +63,16 @@ class ExportApi: ]) rows: list[str] = [] - self.__append_prometheus_rows(rows, atx_state["enabled"], "pikvm_atx_enabled") - self.__append_prometheus_rows(rows, atx_state["leds"]["power"], "pikvm_atx_power") + self.__append_prometheus_rows(rows, atx_state["enabled"], "pikvm_atx_enabled") # type: ignore + self.__append_prometheus_rows(rows, atx_state["leds"]["power"], "pikvm_atx_power") # type: ignore for mode in sorted(UserGpioModes.ALL): - for (channel, ch_state) in gpio_state[f"{mode}s"].items(): + for (channel, ch_state) in gpio_state[f"{mode}s"].items(): # type: ignore if not channel.startswith("__"): # Hide special GPIOs for key in ["online", "state"]: self.__append_prometheus_rows(rows, ch_state["state"], f"pikvm_gpio_{mode}_{key}_{channel}") - self.__append_prometheus_rows(rows, hw_state["health"], "pikvm_hw") + self.__append_prometheus_rows(rows, hw_state["health"], "pikvm_hw") # type: ignore self.__append_prometheus_rows(rows, fan_state, "pikvm_fan") return "\n".join(rows) diff --git a/kvmd/apps/kvmd/api/redfish.py b/kvmd/apps/kvmd/api/redfish.py index 6f157b7b..64f63b0e 100644 --- a/kvmd/apps/kvmd/api/redfish.py +++ b/kvmd/apps/kvmd/api/redfish.py @@ -93,7 +93,7 @@ class RedfishApi: self.__info_manager.get_submanager("meta").get_state(), ]) try: - host = meta_state.get("server", {})["host"] + host = str(meta_state.get("server", {})["host"]) # type: ignore except Exception: host = "" return make_json_response({ @@ -107,7 +107,7 @@ class RedfishApi: }, "Id": "0", "HostName": host, - "PowerState": ("On" if atx_state["leds"]["power"] else "Off"), + "PowerState": ("On" if atx_state["leds"]["power"] else "Off"), # type: ignore }, wrap_result=False) @exposed_http("POST", "/redfish/v1/Systems/0/Actions/ComputerSystem.Reset") |