From 45f6a9f6de91cf874d10bc633a046c29f2d43fe6 Mon Sep 17 00:00:00 2001 From: liujun Date: Tue, 28 May 2024 14:43:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=20#7440?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_plugins/cmdb_ip_picker/utils.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/pipeline_plugins/cmdb_ip_picker/utils.py b/pipeline_plugins/cmdb_ip_picker/utils.py index c361355268..33bbd463e7 100644 --- a/pipeline_plugins/cmdb_ip_picker/utils.py +++ b/pipeline_plugins/cmdb_ip_picker/utils.py @@ -11,7 +11,6 @@ specific language governing permissions and limitations under the License. """ import logging -import math import re import requests @@ -775,24 +774,3 @@ def format_agent_data(agents): val = {"ip": agent["ip"], "bk_cloud_id": agent["cloud_area"]["id"], "bk_agent_alive": agent["alive"]} agent_data[key] = val return agent_data - - -def agent_params_pagination(data, bk_biz_id): - params_list = [] - page_size = 1000 - page = math.ceil(len(data) / page_size) - for i in range(page): - agent_kwargs = { - "all_scope": True, - "host_list": [ - { - "cloud_id": host["bk_cloud_id"], - "ip": host["bk_host_innerip"], - "meta": {"bk_biz_id": bk_biz_id, "scope_type": "biz", "scope_id": bk_biz_id}, - } - for host in data[i * page_size : (i + 1) * page_size] - if host.get("bk_host_innerip", "") != "" - ], - } - params_list.append(agent_kwargs) - return params_list