From 0e6e333bd8735cba15c3532d7a0e2d338f19990b Mon Sep 17 00:00:00 2001 From: rabbitali Date: Tue, 23 Jul 2024 19:12:19 +0800 Subject: [PATCH] fix bug with host count in cve fix task --- ...-bug-with-host-count-in-cve-fix-task.patch | 26 +++++++++++++++++++ aops-apollo.spec | 6 ++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 0002-fix-bug-with-host-count-in-cve-fix-task.patch diff --git a/0002-fix-bug-with-host-count-in-cve-fix-task.patch b/0002-fix-bug-with-host-count-in-cve-fix-task.patch new file mode 100644 index 0000000..9a8b106 --- /dev/null +++ b/0002-fix-bug-with-host-count-in-cve-fix-task.patch @@ -0,0 +1,26 @@ +From a82cceada0df66cf48d646a3cd6a55556ebf9962 Mon Sep 17 00:00:00 2001 +From: rabbitali +Date: Tue, 23 Jul 2024 18:55:50 +0800 +Subject: [PATCH 1/1] fix bug with host count in cve fix task + +--- + apollo/database/proxy/task/cve_fix.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/apollo/database/proxy/task/cve_fix.py b/apollo/database/proxy/task/cve_fix.py +index fa3f2a9..1aa5546 100644 +--- a/apollo/database/proxy/task/cve_fix.py ++++ b/apollo/database/proxy/task/cve_fix.py +@@ -121,7 +121,8 @@ class CveFixTaskProxy(TaskProxy): + wait_fix_rpms = dict() + + for task_info in fix_host_rpm_info: +- wait_fix_rpms[task_info["cve_id"]] = dict(rpms=task_info.get("rpms", []), hosts=list(host_dict.keys())) ++ host_list = [host_info["host_id"] for host_info in task_info["host_info"]] ++ wait_fix_rpms[task_info["cve_id"]] = dict(rpms=task_info.get("rpms", []), hosts=host_list) + + hotpatch_fix_rpms, coldpatch_fix_rpms = self._get_cold_and_hotpatch_fix_rpm(wait_fix_rpms, data["takeover"]) + fix_tasks = [] +-- +2.33.0 + diff --git a/aops-apollo.spec b/aops-apollo.spec index 344e3e9..9964e1d 100644 --- a/aops-apollo.spec +++ b/aops-apollo.spec @@ -1,11 +1,12 @@ Name: aops-apollo Version: v2.0.0 -Release: 2 +Release: 3 Summary: Cve management service, monitor machine vulnerabilities and provide fix functions. License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} Source0: %{name}-%{version}.tar.gz Patch0001: 0001-fix-security-advisory-parsing-error.patch +Patch0002: 0002-fix-bug-with-host-count-in-cve-fix-task.patch BuildRequires: python3-setuptools Requires: aops-vulcanus >= v2.0.0 @@ -63,6 +64,9 @@ popd %{python3_sitelib}/aops_apollo_tool/* %changelog +* Tue Jul 23 2024 wenxin - v2.0.0-3 +- fix bug with host count in cve fix task + * Fri Jul 19 2024 wenxin - v2.0.0-2 - fix security advisory parsing error