代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。