Skip to content

Commit

Permalink
fix(backend): 修改客户端克隆集群类型bug TencentBlueKing#8437
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecloud authored and zhangzhw8 committed Dec 5, 2024
1 parent f7ea25d commit b04c4e4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from django.core.management.base import BaseCommand

from backend.configuration.constants import DBType
from backend.db_monitor.models import CollectInstance

logger = logging.getLogger("root")
Expand All @@ -25,7 +26,7 @@ def add_arguments(self, parser):
parser.add_argument(
"-d",
"--dbtype",
choices=["mysql", "redis", "es", "hdfs", "kafka", "pulsar", "influxdb", "all"],
choices=[*DBType.get_values(), "all"],
type=str,
help="db类型",
)
Expand Down
3 changes: 1 addition & 2 deletions dbm-ui/backend/ticket/builders/mysql/mysql_clone_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from rest_framework import serializers

from backend import env
from backend.db_meta.enums import ClusterType
from backend.db_services.mysql.permission.constants import CloneClusterType, CloneType
from backend.db_services.mysql.permission.exceptions import CloneDataHasExpiredException, DBPermissionBaseException
from backend.flow.engine.controller.mysql import MySQLController
Expand Down Expand Up @@ -42,7 +41,7 @@ class MySQLCloneRulesSerializer(SkipToRepresentationMixin, serializers.Serialize
clone_uid = serializers.CharField(help_text=_("权限克隆数据缓存uid"), required=False)
clone_type = serializers.ChoiceField(help_text=_("权限克隆类型"), choices=CloneType.get_choices())
clone_cluster_type = serializers.ChoiceField(
help_text=_("克隆集群类型"), choices=ClusterType.get_choices(), required=False, default=CloneClusterType.MYSQL
help_text=_("克隆集群类型"), choices=CloneClusterType.get_choices(), required=False, default=CloneClusterType.MYSQL
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from rest_framework import serializers

from backend.configuration.constants import DBType
from backend.db_meta.enums import ClusterType
from backend.db_services.mysql.permission.constants import CloneClusterType
from backend.ticket import builders
from backend.ticket.builders.mysql.mysql_clone_rules import (
Expand All @@ -26,7 +25,10 @@

class TendbClusterCloneRulesSerializer(MySQLCloneRulesSerializer):
clone_cluster_type = serializers.ChoiceField(
help_text=_("克隆集群类型"), choices=ClusterType.get_choices(), required=False, default=CloneClusterType.TendbCluster
help_text=_("集群类型"),
choices=CloneClusterType.get_choices(),
required=False,
default=CloneClusterType.TendbCluster,
)


Expand Down

0 comments on commit b04c4e4

Please sign in to comment.