This commit is contained in:
mofeng-git
2024-09-05 19:03:31 +08:00
parent d556032e0e
commit 551e91069d
8 changed files with 17 additions and 19 deletions

View File

@@ -112,7 +112,7 @@ class HwInfoSubmanager(BaseInfoSubmanager):
if name not in self.__dt_cache:
path = os.path.join(f"{env.PROCFS_PREFIX}/proc/device-tree", name)
if not os.path.exists(path):
path = os.path.join(f"{env.PROCFS_PREFIX}/usr/share/kvmd/extras/hw_info/", name)
path = os.path.join(f"{env.PROCFS_PREFIX}/etc/kvmd/hw_info/", name)
try:
self.__dt_cache[name] = (await aiotools.read_file(path)).strip(" \t\r\n\0")
except Exception as err:
@@ -143,7 +143,7 @@ class HwInfoSubmanager(BaseInfoSubmanager):
try:
return int((await aiotools.read_file(temp_path)).strip()) / 1000
except Exception as err:
get_logger(0).warn("Can't read CPU temp from %s: %s", temp_path, err)
#get_logger(0).warn("Can't read CPU temp from %s: %s", temp_path, err)
return None
async def __get_cpu_percent(self) -> (float | None):