Skip to content

Commit

Permalink
fix(redis): redis单据联调 TencentBlueKing#7872
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 23995
  • Loading branch information
WytheLi committed Nov 15, 2024
1 parent e29d3f1 commit d65548f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions dbm-ui/backend/ticket/builders/redis/redis_single_ins_migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,15 @@ class RedisSingleInsMigrateBuilder(builders.FlowParamBuilder):
controller = RedisController.redis_single_ins_migrate

def format_ticket_data(self):
for item in self.ticket_data["infos"]:
item["src_master"] = f'{item["old_nodes"]["master"][0]["ip"]}:{item["old_nodes"]["master"][0]["port"]}'
item["src_slave"] = f'{item["old_nodes"]["slave"][0]["ip"]}:{item["old_nodes"]["slave"][0]["port"]}'

self.ticket_data.update(self.ticket_data["infos"][0])
cluster = Cluster.objects.get(id=self.ticket_data["cluster_id"])
self.ticket_data.update(bk_cloud_id=cluster.bk_cloud_id, db_version=cluster.major_version)
self.ticket_data.update(
cluster_id=cluster.id, bk_cloud_id=cluster.bk_cloud_id, db_version=cluster.major_version
)


class RedisSingleInstanceApplyResourceParamBuilder(builders.ResourceApplyParamBuilder):
def format(self):
self.patch_info_affinity_location(roles=["backend_group"])
self.ticket_data.update(self.ticket_data["infos"][0])

def post_callback(self):
next_flow = self.ticket.next_flow()
Expand Down

0 comments on commit d65548f

Please sign in to comment.