diff --git a/0001-fix-issue-gen-cve-task-failed.patch b/0001-fix-issue-gen-cve-task-failed.patch new file mode 100644 index 0000000000000000000000000000000000000000..d2ea7ac3b4a2137f5caa8aab9c13ebe7b05e7b3d --- /dev/null +++ b/0001-fix-issue-gen-cve-task-failed.patch @@ -0,0 +1,28 @@ +From 614e6462e28c7ab013b669d7a7b2cc9c996a0a3f Mon Sep 17 00:00:00 2001 +From: rabbitali +Date: Wed, 28 Jun 2023 11:57:38 +0800 +Subject: [PATCH 1/1] fix issue:gen cve task failed + +--- + apollo/database/proxy/task.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/apollo/database/proxy/task.py b/apollo/database/proxy/task.py +index dd172b8..ed5e858 100644 +--- a/apollo/database/proxy/task.py ++++ b/apollo/database/proxy/task.py +@@ -3224,8 +3224,9 @@ class TaskProxy(TaskMysqlProxy, TaskEsProxy): + """ + + try: +- exists_cve_count = self.session.query(CveHostAssociation).filter( +- CveHostAssociation.cve_id.in_(cve_id)).count() ++ exists_cve_count = self.session.query(CveHostAssociation.cve_id).filter( ++ CveHostAssociation.cve_id.in_(cve_id)).distinct().count() ++ + + return True if exists_cve_count == len(cve_id) else False + except SQLAlchemyError as error: +-- +2.33.0 + diff --git a/aops-apollo.spec b/aops-apollo.spec index a75382ea1acf63257943c2dc5bee752bf8d0af8f..e57c64d39c2379b4304bf6ffebfa2fcbcaa64d91 100644 --- a/aops-apollo.spec +++ b/aops-apollo.spec @@ -1,10 +1,12 @@ Name: aops-apollo Version: v1.2.2 -Release: 1 +Release: 2 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-issue-gen-cve-task-failed.patch + BuildRequires: python3-setuptools Requires: aops-vulcanus >= v1.2.0 @@ -75,6 +77,9 @@ cp -r hotpatch %{buildroot}/%{python3_sitelib}/dnf-plugins/ %{python3_sitelib}/aops_apollo_tool/* %changelog +* Wed Jun 28 2023 wenxin - v1.2.2-2 +- fix issue:gen cve task failed + * Tue Jun 20 2023 gongzhengtang - v1.2.2-1 - Fixes numerous known issues