From da4337168f548039e49f84002a1ce5dfc0b9f00c Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 16 Jun 2023 18:44:13 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E8=B5=84=E4=BA=A7=E8=AF=A6=E6=83=85=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=20auto=5Fconfig=20=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/models/asset/common.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/assets/models/asset/common.py b/apps/assets/models/asset/common.py index 6e6d6b836..7a564f787 100644 --- a/apps/assets/models/asset/common.py +++ b/apps/assets/models/asset/common.py @@ -206,15 +206,14 @@ class Asset(NodesRelationMixin, AbsConnectivity, JSONFilterMixin, JMSOrgBaseMode @lazyproperty def auto_config(self): platform = self.platform - automation = self.platform.automation auto_config = { 'su_enabled': platform.su_enabled, 'domain_enabled': platform.domain_enabled, 'ansible_enabled': False } + automation = getattr(self.platform, 'automation', None) if not automation: return auto_config - auto_config.update(model_to_dict(automation)) return auto_config