diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_add_slave.py b/dbm-ui/backend/ticket/builders/mysql/mysql_add_slave.py index aee33a3b05..373fed42d7 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_add_slave.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_add_slave.py @@ -52,13 +52,7 @@ def validate(self, attrs): class MysqlAddSlaveParamBuilder(builders.FlowParamBuilder): # 复用重建 slave 的场景 - controller_remote = MySQLController.mysql_add_slave_remote_scene - controller_local = MySQLController.mysql_add_slave_scene - - def build_controller_info(self) -> dict: - backup_source = self.ticket_data.get("backup_source", MySQLBackupSource.LOCAL) - self.controller = getattr(self, f"controller_{backup_source}") - return super().build_controller_info() + controller = MySQLController.mysql_add_slave_remote_scene def format_ticket_data(self): self.ticket_data["add_slave_only"] = True diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_migrate_cluster.py b/dbm-ui/backend/ticket/builders/mysql/mysql_migrate_cluster.py index fc18d390eb..e37d7d16b4 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_migrate_cluster.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_migrate_cluster.py @@ -55,13 +55,7 @@ def validate(self, attrs): class MysqlMigrateClusterParamBuilder(builders.FlowParamBuilder): - controller_remote = MySQLController.mysql_migrate_remote_scene - controller_local = MySQLController.mysql_migrate_cluster_scene - - def build_controller_info(self) -> dict: - backup_source = self.ticket_data.get("backup_source", MySQLBackupSource.LOCAL) - self.controller = getattr(self, f"controller_{backup_source}") - return super().build_controller_info() + controller = MySQLController.mysql_migrate_remote_scene def format_ticket_data(self): if self.ticket_data["ip_source"] == IpSource.RESOURCE_POOL: diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_restore_local_slave.py b/dbm-ui/backend/ticket/builders/mysql/mysql_restore_local_slave.py index d41db9a208..2ea4b6b40e 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_restore_local_slave.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_restore_local_slave.py @@ -49,13 +49,7 @@ def validate(self, attrs): class MysqlRestoreLocalSlaveParamBuilder(builders.FlowParamBuilder): - controller_remote = MySQLController.mysql_restore_local_remote_scene - controller_local = MySQLController.mysql_restore_local_slave_scene - - def build_controller_info(self) -> dict: - backup_source = self.ticket_data.get("backup_source", MySQLBackupSource.LOCAL) - self.controller = getattr(self, f"controller_{backup_source}") - return super().build_controller_info() + controller = MySQLController.mysql_restore_local_remote_scene def format_ticket_data(self): for index, info in enumerate(self.ticket_data["infos"]): diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_restore_slave.py b/dbm-ui/backend/ticket/builders/mysql/mysql_restore_slave.py index e61113ae61..568d483a43 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_restore_slave.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_restore_slave.py @@ -54,13 +54,7 @@ def validate(self, attrs): class MysqlRestoreSlaveParamBuilder(builders.FlowParamBuilder): - controller_remote = MySQLController.mysql_restore_slave_remote_scene - controller_local = MySQLController.mysql_restore_slave_scene - - def build_controller_info(self) -> dict: - backup_source = self.ticket_data.get("backup_source", MySQLBackupSource.LOCAL) - self.controller = getattr(self, f"controller_{backup_source}") - return super().build_controller_info() + controller = MySQLController.mysql_restore_slave_remote_scene def format_ticket_data(self): self.ticket_data["add_slave_only"] = False