From f03bd99e235fc8ff6302301683e015d4ce7bccc1 Mon Sep 17 00:00:00 2001 From: shixuantong Date: Tue, 25 Feb 2025 15:25:38 +0800 Subject: [PATCH] fix cpu_alarm_fd and bmc_fd --- src/python/syssentry/syssentry.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/python/syssentry/syssentry.py b/src/python/syssentry/syssentry.py index c87256d..4a70514 100644 --- a/src/python/syssentry/syssentry.py +++ b/src/python/syssentry/syssentry.py @@ -477,17 +477,19 @@ def main_loop(): return fd_list.append(heartbeat_fd) - cpu_alarm_fd = cpu_alarm_fd_create() - if not cpu_alarm_fd: - close_all_fd() - return - fd_list.append(cpu_alarm_fd) - - bmc_fd = bmc_fd_create() - if not bmc_fd: - close_all_fd() - return - fd_list.append(bmc_fd) + if CPU_EXIST: + cpu_alarm_fd = cpu_alarm_fd_create() + if not cpu_alarm_fd: + close_all_fd() + return + fd_list.append(cpu_alarm_fd) + + if BMC_EXIST: + bmc_fd = bmc_fd_create() + if not bmc_fd: + close_all_fd() + return + fd_list.append(bmc_fd) epoll_fd = select.epoll() for fd in fd_list: -- Gitee