From b3cdfc2b25b4671bce2d21ed961ac01f5cc8810c Mon Sep 17 00:00:00 2001 From: iSecloud <869820505@qq.com> Date: Tue, 27 Feb 2024 10:43:03 +0800 Subject: [PATCH] =?UTF-8?q?refactor(backend):=20=E4=BF=AE=E6=94=B9gtm?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=BC=80=E5=8F=91?= =?UTF-8?q?=E5=88=86=E6=94=AF=E4=B8=BA1.4.0=20#3375?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gtmproject.yaml | 2 +- .../components/collections/mongodb/mongo_shutdown_meta.py | 3 ++- .../db_services/mysql/permission/test_authorize_handler.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gtmproject.yaml b/.gtmproject.yaml index 2cc885e9a7..daf3e196ad 100644 --- a/.gtmproject.yaml +++ b/.gtmproject.yaml @@ -12,7 +12,7 @@ project: # 主分支 default_branch: "master" # 默认目标分支 - default_target_branch: "v1.3.0" + default_target_branch: "v1.4.0" # 默认单据来源 default_source: "github" # 默认事件类型 diff --git a/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_shutdown_meta.py b/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_shutdown_meta.py index ec55a3d9d9..66a037769e 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_shutdown_meta.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mongodb/mongo_shutdown_meta.py @@ -15,6 +15,7 @@ from typing import Dict, List from django.db import transaction +from django.utils.translation import ugettext as _ from pipeline.component_framework.component import Component from pipeline.core.flow.activity import Service @@ -47,7 +48,7 @@ def decommission_proxies(self, cluster: Cluster, proxies: List[Dict]): proxy_objs = common.filter_out_instance_obj(proxies, cluster.proxyinstance_set.all()) _t = common.not_exists(proxies, proxy_objs) if _t: - raise Exception("{} 存在不是本集群的实例下架列表".format(_t)) + raise Exception(_("{} 存在不是本集群的实例下架列表").format(_t)) machine_obj, cc_manage = defaultdict(dict), CcManage(cluster.bk_biz_id) cc_manage.delete_service_instance(bk_instance_ids=[obj.bk_instance_id for obj in proxy_objs]) diff --git a/dbm-ui/backend/tests/db_services/mysql/permission/test_authorize_handler.py b/dbm-ui/backend/tests/db_services/mysql/permission/test_authorize_handler.py index b75960a3c0..8fc56de3c8 100644 --- a/dbm-ui/backend/tests/db_services/mysql/permission/test_authorize_handler.py +++ b/dbm-ui/backend/tests/db_services/mysql/permission/test_authorize_handler.py @@ -16,6 +16,7 @@ import pytest from openpyxl.writer.excel import save_virtual_workbook +from backend.db_meta.enums import ClusterType from backend.db_services.mysql.permission.authorize.dataclass import MySQLAuthorizeMeta, MySQLExcelAuthorizeMeta from backend.db_services.mysql.permission.authorize.handlers import MySQLAuthorizeHandler from backend.db_services.mysql.permission.constants import AUTHORIZE_EXCEL_HEADER @@ -52,7 +53,7 @@ def test_pre_check_excel_rules(self, query_fixture): excel = io.BytesIO(excel_bytes) excel_obj = namedtuple("ExcelObj", ["file"])(file=excel) - excel_authorize = MySQLExcelAuthorizeMeta(authorize_file=excel_obj) + excel_authorize = MySQLExcelAuthorizeMeta(authorize_file=excel_obj, cluster_type=ClusterType.TenDBHA) excel_authorize.authorize_excel_data = ExcelHandler.paser(excel_authorize.authorize_file.file) authorize_data_list = self.handler.pre_check_excel_rules(excel_authorize)