diff --git a/0005-bugfix-update-host-api-request-error.patch b/0005-bugfix-update-host-api-request-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..d87c727716c67f34eb3e348182516b89d59aa261 --- /dev/null +++ b/0005-bugfix-update-host-api-request-error.patch @@ -0,0 +1,33 @@ +From 36f98b43bd571ac9f2f4f9a9fe658684d591d52e Mon Sep 17 00:00:00 2001 +From: rabbitali +Date: Fri, 27 Oct 2023 15:21:54 +0800 +Subject: [PATCH] bugfix: update host api request error when changing username + +--- + zeus/host_manager/view.py | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/zeus/host_manager/view.py b/zeus/host_manager/view.py +index 95e1434..10418d1 100644 +--- a/zeus/host_manager/view.py ++++ b/zeus/host_manager/view.py +@@ -930,11 +930,11 @@ class UpdateHost(BaseResponse): + LOGGER.warning(f"there is a duplicate host address in database " f"when update host {self.host.host_id}!") + return self.response(code=state.PARAM_ERROR, message="there is a duplicate host ssh address in database!") + +- if params.get("ssh_user") or params.get("ssh_port"): +- if not params.get("password") or not params.get("ssh_pkey"): +- return self.response(code=state.PARAM_ERROR, message="please update password or authentication key.") +- self._save_ssh_key(params) +- elif params.get("password") or params.get("ssh_pkey"): ++ if params.get("password") or params.get("ssh_pkey"): + self._save_ssh_key(params) ++ return self.response(callback.update_host_info(params.pop("host_id"), params)) ++ ++ if params.get("ssh_user") or params.get("ssh_port"): ++ return self.response(code=state.PARAM_ERROR, message="please update password or authentication key.") + + return self.response(callback.update_host_info(params.pop("host_id"), params)) +-- +2.33.0 + diff --git a/aops-zeus.spec b/aops-zeus.spec index fb55b9243272a5cbff05fd00c62344d7220858cb..fef8fa566fe6f97d373669e10e39370299ca4ecc 100644 --- a/aops-zeus.spec +++ b/aops-zeus.spec @@ -1,6 +1,6 @@ Name: aops-zeus Version: v1.3.1 -Release: 3 +Release: 4 Summary: A host and user manager service which is the foundation of aops. License: MulanPSL2 URL: https://gitee.com/openeuler/%{name} @@ -9,6 +9,7 @@ Patch0001: 0001-fix-metric-proxy-init-failed-error.patch Patch0002: 0002-add-key-authentication-for-add-host-api.patch Patch0003: 0003-fix-python-prometheus-api-client-import-error.patch Patch0004: 0004-update-the-template-file-contents-for-adding-hosts.patch +Patch0005: 0005-bugfix-update-host-api-request-error.patch BuildRequires: python3-setuptools @@ -49,6 +50,9 @@ cp -r database %{buildroot}/opt/aops/ %changelog +* Fri Oct 27 2023 wenxin - v1.3.1-4 +- Bugfix: update host api request error when changing username + * Thu Oct 26 2023 wenxin - v1.3.1-3 - update the template file contents for adding hosts