Skip to content

Commit

Permalink
fix(backend): 去掉无用的controller #6973
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecloud committed Sep 19, 2024
1 parent 7622434 commit b130838
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 28 deletions.
8 changes: 1 addition & 7 deletions dbm-ui/backend/ticket/builders/mysql/mysql_add_slave.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]):
Expand Down
8 changes: 1 addition & 7 deletions dbm-ui/backend/ticket/builders/mysql/mysql_restore_slave.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b130838

Please sign in to comment.