Skip to content

Commit

Permalink
feature: JOB 执行作业插件不填 IP 参数为空时使用 JOB 侧配置的默认值 (#88)
Browse files Browse the repository at this point in the history
* feature: JOB 执行作业插件不填 IP 参数为空时使用 JOB 侧配置的默认值
* improvement: JOB 执行作业插件当从 CC 中获取不到任何用户传入的 IP 时直接报错
  • Loading branch information
homholueng authored and pagezz-canway committed Apr 15, 2019
1 parent 8c025e4 commit 721ac71
Showing 1 changed file with 8 additions and 4 deletions.
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:
global_vars.append({
'name': _value['name'],
'ip_list': ip_list,
})
else:
global_vars.append({
'name': _value['name'],
Expand Down

0 comments on commit 721ac71

Please sign in to comment.