From a9be3cb6a16ba8d2678fda986cc056b2ac0fde36 Mon Sep 17 00:00:00 2001 From: xiepaup Date: Wed, 27 Nov 2024 15:11:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(redis):=20Redis=E8=84=8F=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E6=B8=85=E7=90=86=20#8226?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bamboo/scene/redis/dirty_machine_clear.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/redis/dirty_machine_clear.py b/dbm-ui/backend/flow/engine/bamboo/scene/redis/dirty_machine_clear.py index 36c1cd8e48..d3c5ec27c9 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/redis/dirty_machine_clear.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/redis/dirty_machine_clear.py @@ -37,7 +37,8 @@ def __init__(self, root_id: str, data: Optional[Dict]): self.precheck() def precheck(self): - for ip in self.data["infos"]: + for host in self.data["clear_hosts"]: + ip = host["ip"] proxy_inst = ProxyInstance.objects.filter( machine__ip=ip, machine__bk_cloud_id=self.data["bk_cloud_id"] ).first() @@ -81,9 +82,8 @@ def dirty_machine_clear_flow(self): "bk_cloud_id":0, "only_clear_dbmeta":True/False, "force": True/False, - "infos":[ - "a.a.a.a", - "b.b.b.b" + "clear_hosts":[ + {"ip":"a.a.a.a"}, ] } """ @@ -99,7 +99,8 @@ def dirty_machine_clear_flow(self): act_kwargs.bk_cloud_id = self.data["bk_cloud_id"] sub_pipelines = [] - for ip in self.data["infos"]: + for host in self.data["clear_hosts"]: + ip = host["ip"] params = { "ip": ip, "force": self.data.get("force", False), @@ -131,7 +132,8 @@ def precheck_4_clean(self): 1. 不能属于任何集群 2. 必须传入正确的 bizID 和 IP """ - for ip in self.data["infos"]: + for host in self.data["clear_hosts"]: + ip = host["ip"] try: host_obj = Machine.objects.get( ip=ip, bk_cloud_id=self.data["bk_cloud_id"], bk_biz_id=self.data["bk_biz_id"]