diff --git a/0010-update-the-exception-catching-type-of-the-function.patch b/0010-update-the-exception-catching-type-of-the-function.patch new file mode 100644 index 0000000000000000000000000000000000000000..f78ed7c4f0758a0890b1eced2af2013375211471 --- /dev/null +++ b/0010-update-the-exception-catching-type-of-the-function.patch @@ -0,0 +1,33 @@ +From 90076e3a777576a482f37db6f67331ffcd2783fb Mon Sep 17 00:00:00 2001 +From: rabbitali +Date: Wed, 27 Dec 2023 10:35:35 +0800 +Subject: [PATCH] update the exception catching type of the function + +--- + zeus/vulnerability_manage/view.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/zeus/vulnerability_manage/view.py b/zeus/vulnerability_manage/view.py +index 37ab633..0a3537a 100644 +--- a/zeus/vulnerability_manage/view.py ++++ b/zeus/vulnerability_manage/view.py +@@ -19,6 +19,7 @@ from flask import Response, request + import sqlalchemy + import gevent + ++from vulcanus.exceptions import DatabaseConnectionFailed + from vulcanus.log.log import LOGGER + from vulcanus.restful.resp import state + from vulcanus.restful.response import BaseResponse +@@ -70,7 +71,7 @@ def query_host_basic_info(host_list: list, username: str) -> Tuple[str, Dict]: + try: + with HostProxy() as proxy: + status_code, host_infos = proxy.get_host_info({"host_list": host_list, "username": username}) +- except sqlalchemy.exc.SQLAlchemyError: ++ except DatabaseConnectionFailed: + LOGGER.error("Connect to database error") + return state.DATABASE_CONNECT_ERROR, dict() + +-- +2.33.0 + diff --git a/aops-zeus.spec b/aops-zeus.spec index 5347e4b83be5682b1a6e84ba08fe37d911fc7f81..404acbc1ecfd40f781eaa59700397c08bfcd527f 100644 --- a/aops-zeus.spec +++ b/aops-zeus.spec @@ -1,6 +1,6 @@ Name: aops-zeus Version: v1.4.0 -Release: 5 +Release: 6 Summary: A host and user manager service which is the foundation of aops. License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} @@ -14,6 +14,7 @@ Patch0006: 0006-update-verification-method-for-adding-host.patch Patch0007: 0007-update-verification-method-for-host-ip-field.patch Patch0008: 0008-check-host-status-when-query-host-detail.patch Patch0009: 0009-fix-error-log-when-query-host-status.patch +Patch0010: 0010-update-the-exception-catching-type-of-the-function.patch BuildRequires: python3-setuptools @@ -54,6 +55,9 @@ cp -r database %{buildroot}/opt/aops/ %changelog +* Wed Dec 27 2023 wenxin - v1.4.0-6 +- update the exception catching type of the function + * Sun Dec 24 2023 luxuexian - v1.4.0-5 - fix error log when query host status