From 8a77a7b8b57c5b0fb8455f3b34fc9b6f3c3a24c1 Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 8 May 2023 19:06:25 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=92=8C=E8=B5=84=E4=BA=A7=EF=BC=8C=E5=8F=AA?= =?UTF-8?q?=E6=9C=89=E5=8D=8F=E8=AE=AE=E5=8C=85=E5=90=AB=E6=97=B6=E6=89=8D?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=85=B3=E8=81=94=E5=92=8C=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/tasks/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/assets/tasks/utils.py b/apps/assets/tasks/utils.py index add8fe0f0..8f1d24c26 100644 --- a/apps/assets/tasks/utils.py +++ b/apps/assets/tasks/utils.py @@ -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)