1 Star 0 Fork 16

PshySimon/sysSentry_xalarm_service

forked from src-openEuler/sysSentry 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-result-when-process-output-is-None.patch 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
桐小哥 提交于 2024-07-26 16:11 . fix result when process output is None
From e8e4fa5fd9e78508567782e17b7b1cb6ace3ef0d Mon Sep 17 00:00:00 2001
From: shixuantong <shixuantong1@huawei.com>
Date: Fri, 26 Jul 2024 15:59:42 +0800
Subject: [PATCH] fix result when process output is None
---
src/python/syssentry/cpu_sentry.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/python/syssentry/cpu_sentry.py b/src/python/syssentry/cpu_sentry.py
index d0bafa8..9287e2f 100644
--- a/src/python/syssentry/cpu_sentry.py
+++ b/src/python/syssentry/cpu_sentry.py
@@ -87,11 +87,19 @@ class CpuSentry:
}
def handle_cpu_output(self, stdout: str):
+ if not stdout:
+ logging.error("%s process output is None, it may be killed!", LOW_LEVEL_INSPECT_CMD)
+ self.send_result["result"] = ResultLevel.FAIL
+ self.send_result["details"]["code"] = 1005
+ self.send_result["details"]["msg"] = "cpu_sentry task is killed!"
+ return
+
if "ERROR" in stdout:
self.send_result["result"] = ResultLevel.FAIL
self.send_result["details"]["code"] = 1004
self.send_result["details"]["msg"] = stdout.split("\n")[0]
return
+
out_split = stdout.split("\n")
isolated_cores_number = 0
found_fault_cores_list = []
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pshysimon/sysSentry_xalarm_service.git
git@gitee.com:pshysimon/sysSentry_xalarm_service.git
pshysimon
sysSentry_xalarm_service
sysSentry_xalarm_service
master

搜索帮助