Skip to content

Commit

Permalink
fix: 删除多余代码 #7440
Browse files Browse the repository at this point in the history
  • Loading branch information
lTimej committed May 28, 2024
1 parent ce36a64 commit 45f6a9f
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions pipeline_plugins/cmdb_ip_picker/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
specific language governing permissions and limitations under the License.
"""
import logging
import math
import re

import requests
Expand Down Expand Up @@ -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

0 comments on commit 45f6a9f

Please sign in to comment.