Skip to content

Commit

Permalink
fix: 修复未写入db_module_id TencentBlueKing#7186
Browse files Browse the repository at this point in the history
  • Loading branch information
zfrendo committed Sep 30, 2024
1 parent cbf5ee7 commit 0e0ab55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ def storage_create(
)

api.machine.create(machines=machines, creator=creator, bk_cloud_id=bk_cloud_id)
machine_objects = Machine.objects.filter(bk_cloud_id=bk_cloud_id, ip__in=[machine_ips])
machine_objects.update(db_module_id=cluster.db_module_id)
machine_objs = Machine.objects.filter(bk_cloud_id=bk_cloud_id, ip__in=machine_ips)
machine_objs.update(db_module_id=cluster.db_module_id)
api.storage_instance.create(
instances=storages, creator=creator, time_zone=time_zone, status=InstanceStatus.RESTORING
)
Expand Down
8 changes: 4 additions & 4 deletions dbm-ui/backend/flow/utils/mysql/mysql_db_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,10 @@ def slave_recover_add_instance(self):
bk_cloud_id=int(self.ticket_data["bk_cloud_id"]),
creator=self.ticket_data["created_by"],
)
machines = Machine.objects.filter(
machine_objs = Machine.objects.filter(
bk_cloud_id=self.ticket_data["bk_cloud_id"], ip=self.cluster["install_ip"]
)
machines.update(db_module_id=self.ticket_data["db_module_id"])
machine_objs.update(db_module_id=self.ticket_data["db_module_id"])
storage_objs = api.storage_instance.create(
instances=storage_instances,
creator=self.ticket_data["created_by"],
Expand Down Expand Up @@ -850,11 +850,11 @@ def migrate_cluster_add_instance(self):
api.machine.create(
bk_cloud_id=self.ticket_data["bk_cloud_id"], machines=machines, creator=self.ticket_data["created_by"]
)
machines = Machine.objects.filter(
machines_objs = Machine.objects.filter(
bk_cloud_id=self.ticket_data["bk_cloud_id"],
ip__in=[self.cluster["new_slave_ip"], self.cluster["new_master_ip"]],
)
machines.update(db_module_id=self.ticket_data["db_module_id"])
machines_objs.update(db_module_id=self.ticket_data["db_module_id"])
storage_objs = api.storage_instance.create(
instances=storage_instances,
creator=self.ticket_data["created_by"],
Expand Down

0 comments on commit 0e0ab55

Please sign in to comment.