perf: 优化系统用户和资产,只有协议包含时才进行关联和推送

pull/10419/head
Bai 2023-05-08 19:06:25 +08:00 committed by Jiangjie.Bai
parent 7eed182627
commit 8a77a7b8b5
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ def clean_ansible_task_hosts(assets, system_user=None):
if not check_asset_can_run_ansible(asset):
continue
# 资产平台不包含系统用户的协议, 不推送
if system_user.protocol not in asset.protocols_as_dict:
if system_user and system_user.protocol not in asset.protocols_as_dict:
logger.info(_('Asset protocol not support system user protocol, skipped: {}').format(system_user.protocol))
continue
cleaned_assets.append(asset)