diff options
Diffstat (limited to 'kvmd/apps')
-rw-r--r-- | kvmd/apps/kvmd/info/hw.py | 6 | ||||
-rw-r--r-- | kvmd/apps/vnc/vncauth.py | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/kvmd/apps/kvmd/info/hw.py b/kvmd/apps/kvmd/info/hw.py index 86efd761..881f54aa 100644 --- a/kvmd/apps/kvmd/info/hw.py +++ b/kvmd/apps/kvmd/info/hw.py @@ -31,7 +31,7 @@ from ....logging import get_logger from .... import env from .... import tools -from .... import aiofs +from .... import aiotools from .... import aioproc from .base import BaseInfoSubmanager @@ -90,7 +90,7 @@ class HwInfoSubmanager(BaseInfoSubmanager): if name not in self.__dt_cache: path = os.path.join(f"{env.PROCFS_PREFIX}/proc/device-tree", name) try: - self.__dt_cache[name] = (await aiofs.read(path)).strip(" \t\r\n\0") + self.__dt_cache[name] = (await aiotools.read_file(path)).strip(" \t\r\n\0") except Exception as err: get_logger(0).error("Can't read DT %s from %s: %s", name, path, err) return None @@ -99,7 +99,7 @@ class HwInfoSubmanager(BaseInfoSubmanager): async def __get_cpu_temp(self) -> (float | None): temp_path = f"{env.SYSFS_PREFIX}/sys/class/thermal/thermal_zone0/temp" try: - return int((await aiofs.read(temp_path)).strip()) / 1000 + return int((await aiotools.read_file(temp_path)).strip()) / 1000 except Exception as err: get_logger(0).error("Can't read CPU temp from %s: %s", temp_path, err) return None diff --git a/kvmd/apps/vnc/vncauth.py b/kvmd/apps/vnc/vncauth.py index c7c04864..ebda9ef4 100644 --- a/kvmd/apps/vnc/vncauth.py +++ b/kvmd/apps/vnc/vncauth.py @@ -24,7 +24,7 @@ import dataclasses from ...logging import get_logger -from ... import aiofs +from ... import aiotools # ===== @@ -61,8 +61,7 @@ class VncAuthManager: return ({}, (not self.__enabled)) async def __inner_read_credentials(self) -> dict[str, VncAuthKvmdCredentials]: - lines = (await aiofs.read(self.__path)).split("\n") - + lines = (await aiotools.read_file(self.__path)).split("\n") credentials: dict[str, VncAuthKvmdCredentials] = {} for (lineno, line) in enumerate(lines): if len(line.strip()) == 0 or line.lstrip().startswith("#"): |