!128 【bugfix】修复操作名可修改为已存在的值
From: @rearcher Reviewed-by: @Lostwayzxc Signed-off-by: @Lostwayzxc
This commit is contained in:
commit
43aa7f8e9a
31
0001-fix-operation-name-modified-error.patch
Normal file
31
0001-fix-operation-name-modified-error.patch
Normal file
@ -0,0 +1,31 @@
|
||||
From f61bce925842ab6ff5f9de2d473a3f9e9909b7fa Mon Sep 17 00:00:00 2001
|
||||
From: rearcher <123781007@qq.com>
|
||||
Date: Tue, 3 Dec 2024 11:18:12 +0800
|
||||
Subject: [PATCH] =?UTF-8?q?bugfix:=E4=BF=AE=E5=A4=8D=E6=93=8D=E4=BD=9C?=
|
||||
=?UTF-8?q?=E5=90=8D=E5=8F=AF=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=B7=B2=E5=AD=98?=
|
||||
=?UTF-8?q?=E5=9C=A8=E7=9A=84=E5=80=BC?=
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
---
|
||||
operation-service/zeus/operation_service/app/proxy/operate.py | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/operation-service/zeus/operation_service/app/proxy/operate.py b/operation-service/zeus/operation_service/app/proxy/operate.py
|
||||
index ea5c18a..f3d51d4 100644
|
||||
--- a/operation-service/zeus/operation_service/app/proxy/operate.py
|
||||
+++ b/operation-service/zeus/operation_service/app/proxy/operate.py
|
||||
@@ -107,6 +107,9 @@ class OperateProxy(MysqlProxy):
|
||||
|
||||
def modify_operate_info(self, operate_id, data):
|
||||
try:
|
||||
+ operate = self.session.query(Operate).filter(Operate.operate_name == data['operate_name']).first()
|
||||
+ if operate:
|
||||
+ return DATA_EXIST, None
|
||||
modified_rows = self.session.query(Operate).filter_by(operate_id = operate_id).update(data)
|
||||
self.session.commit()
|
||||
if modified_rows != 1:
|
||||
--
|
||||
Gitee
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
%define vulcanus_version v2.0.0
|
||||
Name: aops-zeus
|
||||
Version: v2.1.0
|
||||
Release: 2
|
||||
Release: 3
|
||||
Summary: A service which is the foundation of aops.
|
||||
License: MulanPSL2
|
||||
URL: https://gitee.com/openeuler/%{name}
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
Patch0001: 0001-fix-operation-name-modified-error.patch
|
||||
|
||||
|
||||
BuildRequires: python3-setuptools
|
||||
@ -57,7 +58,7 @@ Requires: python3-uWSGI python3-gevent
|
||||
A distributed service of aops.
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version}
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
|
||||
|
||||
# build for aops-zeus
|
||||
@ -167,6 +168,9 @@ popd
|
||||
%{python3_sitelib}/zeus/distribute_service/*
|
||||
|
||||
%changelog
|
||||
* Tue Dec 03 2024 luxuexian<luxuexian@huawei.com> - v2.1.0-3
|
||||
- Prevents the operation name from being modified to an existing value
|
||||
|
||||
* Tue Nov 19 2024 luxuexian<luxuexian@huawei.com> - v2.1.0-2
|
||||
- support osmind operation
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user