!22 [sync] PR-21: fix configparser.InterpolationSyntaxError
From: @openeuler-sync-bot Reviewed-by: @gaoruoshu Signed-off-by: @gaoruoshu
This commit is contained in:
commit
cbefd05b36
37
fix-configparser.InterpolationSyntaxError.patch
Normal file
37
fix-configparser.InterpolationSyntaxError.patch
Normal file
@ -0,0 +1,37 @@
|
||||
From 65ceade489c4018c3f315104d70be0550a28d9d9 Mon Sep 17 00:00:00 2001
|
||||
From: shixuantong <shixuantong1@huawei.com>
|
||||
Date: Wed, 11 Sep 2024 10:23:41 +0800
|
||||
Subject: [PATCH] fix configparser.InterpolationSyntaxError
|
||||
|
||||
---
|
||||
src/python/syssentry/sentry_config.py | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/python/syssentry/sentry_config.py b/src/python/syssentry/sentry_config.py
|
||||
index 01f3df8..a0e7b79 100644
|
||||
--- a/src/python/syssentry/sentry_config.py
|
||||
+++ b/src/python/syssentry/sentry_config.py
|
||||
@@ -103,14 +103,18 @@ class CpuPluginsParamsConfig:
|
||||
"""read config file"""
|
||||
config_param_section_args = {}
|
||||
if os.path.exists(self.config_file):
|
||||
- self.config.read(self.config_file)
|
||||
try:
|
||||
+ self.config.read(self.config_file)
|
||||
config_param_section_args = dict(self.config[self.param_section_name])
|
||||
- except (ValueError, KeyError):
|
||||
+ except (ValueError, KeyError, configparser.InterpolationSyntaxError):
|
||||
config_param_section_args = {}
|
||||
+ logging.error("Failed to parse cpu_sentry.ini!")
|
||||
return config_param_section_args
|
||||
|
||||
def join_cpu_start_cmd(self, cpu_param_dict: dict) -> str:
|
||||
+ if not cpu_param_dict:
|
||||
+ return ""
|
||||
+
|
||||
cpu_list = cpu_param_dict.get("cpu_list", "default")
|
||||
if cpu_list == "default":
|
||||
cpu_list = CpuPluginsParamsConfig.get_cpu_info()
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
Summary: System Inspection Framework
|
||||
Name: sysSentry
|
||||
Version: 1.0.2
|
||||
Release: 10
|
||||
Release: 11
|
||||
License: Mulan PSL v2
|
||||
Group: System Environment/Daemons
|
||||
Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
||||
@ -20,6 +20,7 @@ Patch7: param-must-be-integer.patch
|
||||
Patch8: add-deleted-code-to-plugin-rasdaemon.patch
|
||||
Patch9: Remove-ANSI-escape-sequences.patch
|
||||
Patch10: split-cpu_sentry-and-syssentry.patch
|
||||
Patch11: fix-configparser.InterpolationSyntaxError.patch
|
||||
|
||||
BuildRequires: cmake gcc-c++
|
||||
BuildRequires: python3 python3-setuptools
|
||||
@ -177,6 +178,12 @@ rm -rf %{buildroot}
|
||||
%attr(0550,root,root) %{python3_sitelib}/syssentry/cpu_*
|
||||
|
||||
%changelog
|
||||
* Wed Sep 11 2024 shixuantong <shixuantong1@huawei.com> - 1.0.2-11
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:fix configparser.InterpolationSyntaxError
|
||||
|
||||
* Mon Sep 09 2024 caixiaomeng <caixiaomeng2@huawei.com> - 1.0.2-10
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user