diff --git a/0001-change-the-datatype-of-host_id.patch b/0001-change-the-datatype-of-host_id.patch new file mode 100644 index 0000000000000000000000000000000000000000..3a6d13b7da0e1ca00f78a084e9060f0dfb065ca8 --- /dev/null +++ b/0001-change-the-datatype-of-host_id.patch @@ -0,0 +1,46 @@ +From 48652b0fbb210bc31407402deb72815856100e27 Mon Sep 17 00:00:00 2001 +From: wang_kun +Date: Mon, 11 Sep 2023 09:19:27 +0800 +Subject: [PATCH] =?UTF-8?q?host=5Fid=E8=BD=ACstr=E7=B1=BB=E5=9E=8B?= +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +--- + diana/core/experiment/app/mysql_network_diagnose.py | 4 ++-- + diana/core/rule/workflow.py | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/diana/core/experiment/app/mysql_network_diagnose.py b/diana/core/experiment/app/mysql_network_diagnose.py +index e2b6ec4..b12731e 100644 +--- a/diana/core/experiment/app/mysql_network_diagnose.py ++++ b/diana/core/experiment/app/mysql_network_diagnose.py +@@ -72,10 +72,10 @@ class MysqlNetworkDiagnoseApp(App): + """ + result = {} + for host_id, metrics in data.items(): +- if metrics is None or detail.get(host_id) is None: ++ if metrics is None or detail.get(str(host_id)) is None: + continue + +- model_id = detail[host_id] ++ model_id = detail[str(host_id)] + model: Algorithm = self.model.get(model_id) + result[host_id] = model.calculate(metrics, time_range) + +diff --git a/diana/core/rule/workflow.py b/diana/core/rule/workflow.py +index a4c16e2..e189c21 100644 +--- a/diana/core/rule/workflow.py ++++ b/diana/core/rule/workflow.py +@@ -246,7 +246,7 @@ class Workflow: + network_monitor_data = self._get_app_execute_result( + time_range, workflow["hosts"], workflow["workflow"]) + LOGGER.debug(network_monitor_data) +- if isinstance(network_monitor_data, int): ++ if isinstance(network_monitor_data, str): + return network_monitor_data + + storage_status, kafka_status = DATABASE_INSERT_ERROR, DATABASE_INSERT_ERROR +-- +2.33.0 + diff --git a/aops-diana.spec b/aops-diana.spec index aa235cedba816f0baceef1fe95074b90db4f105e..5089d7a162dcebb1a3332061de6a6cf85421f2d4 100644 --- a/aops-diana.spec +++ b/aops-diana.spec @@ -1,10 +1,11 @@ Name: aops-diana Version: v1.2.0 -Release: 1 +Release: 2 Summary: An intelligent abnormal detection framework of aops License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} Source0: %{name}-%{version}.tar.gz +Patch0: 0001-change-the-datatype-of-host_id.patch BuildRequires: python3-setuptools Requires: aops-vulcanus >= v1.2.0 @@ -21,7 +22,7 @@ An intelligent abnormal detection framework of aops %prep -%autosetup -n %{name}-%{version} +%autosetup -n %{name}-%{version} -p1 # build for aops-diana @@ -45,6 +46,9 @@ An intelligent abnormal detection framework of aops %changelog +* Mon Sep 11 2023 wangkun - v1.2.0-2 +- bugfix:change host_id datatype + * Mon Apr 17 2023 gongzhengtang - v1.2.0-1 - update the structure of response body; update how to get session used to - connect to the database