Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: JOB 执行作业插件不填 IP 参数为空时使用 JOB 侧配置的默认值 #88

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pipeline_plugins/components/collections/sites/open/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,14 @@ def execute(self, data, parent_data):
ip_str=_value['value'],
use_cache=False)
ip_list = [{'ip': _ip['InnerIP'], 'bk_cloud_id': _ip['Source']} for _ip in var_ip['ip_result']]
global_vars.append({
'name': _value['name'],
'ip_list': ip_list,
})
if _value['value'].strip() and not ip_list:
data.outputs.ex_data = _(u"无法从配置平台(CMDB)查询到对应 IP,请确认输入的 IP 是否合法")
return False
if ip_list:
homholueng marked this conversation as resolved.
Show resolved Hide resolved
global_vars.append({
'name': _value['name'],
'ip_list': ip_list,
})
else:
global_vars.append({
'name': _value['name'],
Expand Down