!52 修复python3.7不支持list[bool]的类型标注语法问题

From: @pshysimon 
Reviewed-by: @gaoruoshu 
Signed-off-by: @gaoruoshu
This commit is contained in:
openeuler-ci-bot 2024-10-09 06:36:55 +00:00 committed by Gitee
commit 3830f57e56
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 61 additions and 1 deletions

View File

@ -0,0 +1,53 @@
From 878bcf61467bfd9d015a8089a8367f4333ba76f6 Mon Sep 17 00:00:00 2001
From: PshySimon <caixiaomeng2@huawei.com>
Date: Wed, 9 Oct 2024 10:20:34 +0800
Subject: [PATCH] fix python 3.7 not support list[bool] type
---
src/python/xalarm/register_xalarm.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/python/xalarm/register_xalarm.py b/src/python/xalarm/register_xalarm.py
index e58343d..6756b1b 100644
--- a/src/python/xalarm/register_xalarm.py
+++ b/src/python/xalarm/register_xalarm.py
@@ -26,7 +26,7 @@ ALARM_REGISTER_INFO = None
class AlarmRegister:
- def __init__(self, id_filter: list[bool], callback: callable):
+ def __init__(self, id_filter: list, callback: callable):
self.id_filter = id_filter
self.callback = callback
self.socket = self.create_unix_socket()
@@ -49,7 +49,7 @@ class AlarmRegister:
return False
return True
- def set_id_filter(self, id_filter: list[bool]) -> bool:
+ def set_id_filter(self, id_filter: list) -> bool:
if (len(id_filter) > MAX_NUM_OF_ALARM_ID):
sys.stderr.write("set_id_filter: invalid param id_filter\n")
return False
@@ -118,7 +118,7 @@ class AlarmRegister:
self.socket.close()
-def xalarm_register(callback: callable, id_filter: list[bool]) -> int:
+def xalarm_register(callback: callable, id_filter: list) -> int:
global ALARM_REGISTER_INFO
if ALARM_REGISTER_INFO is not None:
@@ -148,7 +148,7 @@ def xalarm_unregister(clientId: int) -> None:
ALARM_REGISTER_INFO = None
-def xalarm_upgrade(clientId: int, id_filter: list[bool]) -> None:
+def xalarm_upgrade(clientId: int, id_filter: list) -> None:
global ALARM_REGISTER_INFO
if clientId < 0:
sys.stderr.write("xalarm_unregister: invalid client\n")
--
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: 21 Release: 22
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
@ -33,6 +33,7 @@ Patch20: add-log-level-and-change-log-format.patch
Patch21: fix-ai_block_io-some-issues.patch Patch21: fix-ai_block_io-some-issues.patch
Patch22: add-pyxalarm-and-pySentryNotify-add-multi-users-supp.patch Patch22: add-pyxalarm-and-pySentryNotify-add-multi-users-supp.patch
Patch23: add-sentryctl-get_alarm-module_name-s-time_range-d.patch Patch23: add-sentryctl-get_alarm-module_name-s-time_range-d.patch
Patch24: fix-python-3.7-not-support-list-bool-type.patch
BuildRequires: cmake gcc-c++ BuildRequires: cmake gcc-c++
BuildRequires: python3 python3-setuptools BuildRequires: python3 python3-setuptools
@ -275,6 +276,12 @@ rm -rf %{buildroot}
%attr(0550,root,root) %{python3_sitelib}/sentryPlugins/ai_block_io %attr(0550,root,root) %{python3_sitelib}/sentryPlugins/ai_block_io
%changelog %changelog
* Wed Oct 9 2024 caixiaomeng <caixiaomeng2@huawei.com> - 1.0.2-22
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:fix python 3.7 not support list bool type
* Tue Oct 8 2024 jinsaihang <jinsaihang@h-partners.com> - 1.0.2-21 * Tue Oct 8 2024 jinsaihang <jinsaihang@h-partners.com> - 1.0.2-21
- Type:bugfix - Type:bugfix
- CVE:NA - CVE:NA