!149 get_alarm details abnormal display

From: @boluo56 
Reviewed-by: @hubin95 
Signed-off-by: @hubin95
This commit is contained in:
openeuler-ci-bot 2024-10-31 07:22:22 +00:00 committed by Gitee
commit 401f75026b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,26 @@
From 132334913c4afebefd6afa835f790fa8a5fbf123 Mon Sep 17 00:00:00 2001
From: jinsaihang <jinsaihang@h-partners.com>
Date: Mon, 28 Oct 2024 09:22:53 +0800
Subject: [PATCH] get_alarm -d abnomal display
Signed-off-by: jinsaihang <jinsaihang@h-partners.com>
---
sysSentry-1.0.2/src/python/syssentry/alarm.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/python/syssentry/alarm.py b/src/python/syssentry/alarm.py
index b35a126..e5cc313 100644
--- a/src/python/syssentry/alarm.py
+++ b/src/python/syssentry/alarm.py
@@ -184,7 +184,7 @@ def get_alarm_result(task_name: str, time_range: int, detailed: bool) -> List[Di
# dump each {key,value} of details in one line
if 'details' in alarm_info and isinstance(alarm_info['details'], dict):
for key in alarm_info['details']:
- alarm_info['details'][key] = json.dumps(alarm_info['details'][key], indent=None)
+ alarm_info['details'][key] = str(alarm_info['details'][key])
alarm['alarm_info'] = alarm_info
alarm_list = [alarm for alarm in alarm_list if 'alarm_source' in alarm['alarm_info'] and alarm['alarm_info']['alarm_source'] == task_name]
--
2.27.0

View File

@ -4,7 +4,7 @@
Summary: System Inspection Framework Summary: System Inspection Framework
Name: sysSentry Name: sysSentry
Version: 1.0.2 Version: 1.0.2
Release: 53 Release: 54
License: Mulan PSL v2 License: Mulan PSL v2
Group: System Environment/Daemons Group: System Environment/Daemons
Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz
@ -73,6 +73,7 @@ Patch60: fix-get_alarm-error.patch
Patch61: fix-alarm_info-newline-break-error.patch Patch61: fix-alarm_info-newline-break-error.patch
Patch62: add-hbm-online-repair.patch Patch62: add-hbm-online-repair.patch
Patch63: fix-hbm-online-repair-notice-and-efi-create.patch Patch63: fix-hbm-online-repair-notice-and-efi-create.patch
Patch64: get_alarm-d-abnomal-display.patch
BuildRequires: cmake gcc-c++ BuildRequires: cmake gcc-c++
BuildRequires: python3 python3-setuptools BuildRequires: python3 python3-setuptools
@ -366,6 +367,12 @@ rm -rf %{buildroot}
%attr(0550,root,root) %{python3_sitelib}/syssentry/bmc_alarm.py %attr(0550,root,root) %{python3_sitelib}/syssentry/bmc_alarm.py
%changelog %changelog
* Tue Oct 29 2024 jinsaihang <jinsaihang@h-partners.com> - 1.0.2-54
- Type:bugfix
- CVE:NA
- SUG:NA
- DES:get_alarm -d abnormal display
* Wed Oct 30 2024 luckky <guodashun1@huawei.com> - 1.0.2-53 * Wed Oct 30 2024 luckky <guodashun1@huawei.com> - 1.0.2-53
- Type:bugfix - Type:bugfix
- CVE:NA - CVE:NA