diff --git a/ai_block_io-from-relative-import-to-absolute-import.patch b/ai_block_io-from-relative-import-to-absolute-import.patch new file mode 100644 index 0000000000000000000000000000000000000000..b66b36bca60e56709d86d245292890f356a1af42 --- /dev/null +++ b/ai_block_io-from-relative-import-to-absolute-import.patch @@ -0,0 +1,126 @@ +From 3317adff9ed4b46504b8d0fcfa9c7615f8ac4d8c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E8=B4=BA=E6=9C=89=E5=BF=97?= <1037617413@qq.com> +Date: Fri, 11 Oct 2024 11:46:20 +0800 +Subject: [PATCH] ai_block_io from relative import to absolute import + +--- + .../sentryPlugins/ai_block_io/ai_block_io.py | 17 +++++++++-------- + .../sentryPlugins/ai_block_io/config_parser.py | 4 ++-- + .../sentryPlugins/ai_block_io/data_access.py | 2 +- + .../sentryPlugins/ai_block_io/detector.py | 8 ++++---- + .../sentryPlugins/ai_block_io/threshold.py | 2 +- + src/python/sentryPlugins/ai_block_io/utils.py | 6 +++--- + 6 files changed, 20 insertions(+), 19 deletions(-) + +diff --git a/src/python/sentryPlugins/ai_block_io/ai_block_io.py b/src/python/sentryPlugins/ai_block_io/ai_block_io.py +index 77104a9..3b55590 100644 +--- a/src/python/sentryPlugins/ai_block_io/ai_block_io.py ++++ b/src/python/sentryPlugins/ai_block_io/ai_block_io.py +@@ -13,14 +13,14 @@ import time + import signal + import logging + +-from .detector import Detector +-from .threshold import ThresholdFactory, AbsoluteThreshold +-from .sliding_window import SlidingWindowFactory +-from .utils import get_data_queue_size_and_update_size +-from .config_parser import ConfigParser +-from .data_access import get_io_data_from_collect_plug, check_collect_valid +-from .io_data import MetricName +-from .alarm_report import Xalarm, Report ++from sentryPlugins.ai_block_io.detector import Detector ++from sentryPlugins.ai_block_io.threshold import ThresholdFactory, AbsoluteThreshold ++from sentryPlugins.ai_block_io.sliding_window import SlidingWindowFactory ++from sentryPlugins.ai_block_io.utils import get_data_queue_size_and_update_size ++from sentryPlugins.ai_block_io.config_parser import ConfigParser ++from sentryPlugins.ai_block_io.data_access import get_io_data_from_collect_plug, check_collect_valid ++from sentryPlugins.ai_block_io.io_data import MetricName ++from sentryPlugins.ai_block_io.alarm_report import Xalarm, Report + + CONFIG_FILE = "/etc/sysSentry/plugins/ai_block_io.ini" + +@@ -155,3 +155,4 @@ def main(): + # Step4:启动慢IO检测 + slow_io_detection = SlowIODetection(config) + slow_io_detection.launch() ++ +diff --git a/src/python/sentryPlugins/ai_block_io/config_parser.py b/src/python/sentryPlugins/ai_block_io/config_parser.py +index 354c122..8c23d46 100644 +--- a/src/python/sentryPlugins/ai_block_io/config_parser.py ++++ b/src/python/sentryPlugins/ai_block_io/config_parser.py +@@ -12,8 +12,8 @@ + import configparser + import logging + +-from .threshold import ThresholdType +-from .utils import get_threshold_type_enum, get_sliding_window_type_enum, get_log_level ++from sentryPlugins.ai_block_io.threshold import ThresholdType ++from sentryPlugins.ai_block_io.utils import get_threshold_type_enum, get_sliding_window_type_enum, get_log_level + + + LOG_FORMAT = "%(asctime)s - %(levelname)s - [%(filename)s:%(lineno)d] - %(message)s" +diff --git a/src/python/sentryPlugins/ai_block_io/data_access.py b/src/python/sentryPlugins/ai_block_io/data_access.py +index c7679cd..3df8734 100644 +--- a/src/python/sentryPlugins/ai_block_io/data_access.py ++++ b/src/python/sentryPlugins/ai_block_io/data_access.py +@@ -19,7 +19,7 @@ from sentryCollector.collect_plugin import ( + ) + + +-from .io_data import IOStageData, IOData ++from sentryPlugins.ai_block_io.io_data import IOStageData, IOData + + COLLECT_STAGES = [ + "throtl", +diff --git a/src/python/sentryPlugins/ai_block_io/detector.py b/src/python/sentryPlugins/ai_block_io/detector.py +index 0ed282b..4f0ea24 100644 +--- a/src/python/sentryPlugins/ai_block_io/detector.py ++++ b/src/python/sentryPlugins/ai_block_io/detector.py +@@ -10,10 +10,10 @@ + # See the Mulan PSL v2 for more details. + import logging + +-from .io_data import MetricName +-from .threshold import Threshold +-from .sliding_window import SlidingWindow +-from .utils import get_metric_value_from_io_data_dict_by_metric_name ++from sentryPlugins.ai_block_io.io_data import MetricName ++from sentryPlugins.ai_block_io.threshold import Threshold ++from sentryPlugins.ai_block_io.sliding_window import SlidingWindow ++from sentryPlugins.ai_block_io.utils import get_metric_value_from_io_data_dict_by_metric_name + + + class Detector: +diff --git a/src/python/sentryPlugins/ai_block_io/threshold.py b/src/python/sentryPlugins/ai_block_io/threshold.py +index 3b7a5a8..8f9c8de 100644 +--- a/src/python/sentryPlugins/ai_block_io/threshold.py ++++ b/src/python/sentryPlugins/ai_block_io/threshold.py +@@ -14,7 +14,7 @@ import queue + import numpy as np + import math + +-from .sliding_window import SlidingWindow ++from sentryPlugins.ai_block_io.sliding_window import SlidingWindow + + + class ThresholdState(Enum): +diff --git a/src/python/sentryPlugins/ai_block_io/utils.py b/src/python/sentryPlugins/ai_block_io/utils.py +index 8dbba06..c41ce1a 100644 +--- a/src/python/sentryPlugins/ai_block_io/utils.py ++++ b/src/python/sentryPlugins/ai_block_io/utils.py +@@ -13,9 +13,9 @@ import logging + from dataclasses import asdict + + +-from .threshold import ThresholdType +-from .sliding_window import SlidingWindowType +-from .io_data import MetricName, IOData ++from sentryPlugins.ai_block_io.threshold import ThresholdType ++from sentryPlugins.ai_block_io.sliding_window import SlidingWindowType ++from sentryPlugins.ai_block_io.io_data import MetricName, IOData + + + def get_threshold_type_enum(algorithm_type: str): +-- +2.23.0 + diff --git a/sysSentry.spec b/sysSentry.spec index f37ba628cf1cf33ea0a1fe98e1d8d3b7491cb58e..eb45e4d2585976580cb650412d9189a20c126a21 100644 --- a/sysSentry.spec +++ b/sysSentry.spec @@ -4,7 +4,7 @@ Summary: System Inspection Framework Name: sysSentry Version: 1.0.2 -Release: 29 +Release: 30 License: Mulan PSL v2 Group: System Environment/Daemons Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz @@ -42,6 +42,7 @@ Patch29: change-alarm-length.patch Patch30: add-detail-time.patch Patch31: xalarm-add-alarm-msg-length-to-8192.patch Patch32: ai_block_io-adapt-alarm-module.patch +Patch33: ai_block_io-from-relative-import-to-absolute-import.patch BuildRequires: cmake gcc-c++ BuildRequires: python3 python3-setuptools @@ -286,6 +287,12 @@ rm -rf %{buildroot} %attr(0550,root,root) %{python3_sitelib}/sentryPlugins/ai_block_io %changelog +* Fri Oct 11 2024 heyouzhi - 1.0.2-30 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:ai_block_io from relative import to absolute import + * Thu Oct 10 2024 heyouzhi - 1.0.2-29 - Type:requirement - CVE:NA