Skip to content

Commit

Permalink
fix(backend): 补充checksum参数 #1522
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecloud committed Oct 25, 2023
1 parent c47a239 commit c458c6e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions dbm-ui/backend/ticket/builders/mysql/mysql_checksum.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ def patch_ticket_detail(self):
cluster__id__in=cluster_ids, instance_inner_role=InstanceInnerRole.MASTER
)
cluster_id__master_map = {
master.cluster.first().id: {"id": master.id, **DBInstance.from_inst_obj(master).as_dict()}
master.cluster.first().id: {
"id": master.id,
"instance_inner_role": master.instance_inner_role,
**DBInstance.from_inst_obj(master).as_dict(),
}
for master in masters
}
for info in self.ticket.details["infos"]:
Expand All @@ -164,7 +168,14 @@ def patch_ticket_detail(self):
# 补充slave信息
slave_insts = StorageInstance.find_insts_by_addresses(info["slaves"])
ip_port__slave_info = {f"{slave['ip']}:{slave['port']}": slave for slave in info.pop("slaves")}
info["slaves"] = [{"id": slave.id, **ip_port__slave_info[slave.ip_port]} for slave in slave_insts]
info["slaves"] = [
{
"id": slave.id,
"instance_inner_role": slave.instance_inner_role,
**ip_port__slave_info[slave.ip_port],
}
for slave in slave_insts
]

self.ticket.save(update_fields=["details"])

Expand Down

0 comments on commit c458c6e

Please sign in to comment.