From f83f54892a7c3fc40e241256f7094647fd8d8c20 Mon Sep 17 00:00:00 2001 From: zhu-yuncheng Date: Wed, 13 Sep 2023 18:35:46 +0800 Subject: [PATCH] fix return all hosts bug --- 0007-fix-return-all-hosts-bug.patch | 24 ++++++++++++++++++++++++ aops-apollo.spec | 8 ++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 0007-fix-return-all-hosts-bug.patch diff --git a/0007-fix-return-all-hosts-bug.patch b/0007-fix-return-all-hosts-bug.patch new file mode 100644 index 0000000..25ba99b --- /dev/null +++ b/0007-fix-return-all-hosts-bug.patch @@ -0,0 +1,24 @@ +From d546740ecd4cbf65908bb38661fa22f84634a609 Mon Sep 17 00:00:00 2001 +From: zhu-yuncheng +Date: Wed, 13 Sep 2023 18:27:12 +0800 +Subject: [PATCH] fix return all host error + +--- + apollo/database/proxy/cve.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/apollo/database/proxy/cve.py b/apollo/database/proxy/cve.py +index 298ce33..95de25c 100644 +--- a/apollo/database/proxy/cve.py ++++ b/apollo/database/proxy/cve.py +@@ -498,7 +498,7 @@ class CveMysqlProxy(MysqlProxy): + # when query host to fix, only query the ones which have available rpm to fix + if not fixed: + filters.add(CveHostAssociation.available_rpm != None) +- elif host_list: ++ if host_list: + filters.add(Host.host_id.in_(host_list)) + + cve_query = ( +-- +Gitee diff --git a/aops-apollo.spec b/aops-apollo.spec index f714c51..3cc6cb6 100644 --- a/aops-apollo.spec +++ b/aops-apollo.spec @@ -1,6 +1,6 @@ Name: aops-apollo Version: v1.3.1 -Release: 4 +Release: 5 Summary: Cve management service, monitor machine vulnerabilities and provide fix functions. License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} @@ -10,7 +10,8 @@ Patch0002: 0002-update-api-request-field.patch Patch0003: 0003-fix-generate-rpm-package.patch Patch0004: 0004-fix-dnf-hot-updateinfo-list-cves-bug.patch Patch0005: 0005-remove-filter-for-available-rpm-to-none.patch -Patch0006: 0006-fix-host-ip-are-not-verified-in-the-generation-task.patch +Patch0006: 0006-fix-host-ip-are-not-verified-in-the-generation-task.patch +Patch0007: 0007-fix-return-all-hosts-bug.patch BuildRequires: python3-setuptools Requires: aops-vulcanus >= v1.2.0 @@ -84,6 +85,9 @@ cp -r hotpatch %{buildroot}/%{python3_sitelib}/dnf-plugins/ %{python3_sitelib}/aops_apollo_tool/* %changelog +* Wed Sep 13 2023 zhuyuncheng -v1.3.1-5 +- fix task_cve_host return all host bug + * Wed Sep 13 2023 gongzhengtang -v1.3.1-4 - fixed host ip addresses are not verified in the generation task -- Gitee