perf: 修复自定义资产详情没有 auto_config 的问题

pull/10756/head
ibuler 2023-06-16 18:44:13 +08:00
parent f13966e061
commit da4337168f
1 changed files with 1 additions and 2 deletions

View File

@ -206,15 +206,14 @@ class Asset(NodesRelationMixin, AbsConnectivity, JSONFilterMixin, JMSOrgBaseMode
@lazyproperty @lazyproperty
def auto_config(self): def auto_config(self):
platform = self.platform platform = self.platform
automation = self.platform.automation
auto_config = { auto_config = {
'su_enabled': platform.su_enabled, 'su_enabled': platform.su_enabled,
'domain_enabled': platform.domain_enabled, 'domain_enabled': platform.domain_enabled,
'ansible_enabled': False 'ansible_enabled': False
} }
automation = getattr(self.platform, 'automation', None)
if not automation: if not automation:
return auto_config return auto_config
auto_config.update(model_to_dict(automation)) auto_config.update(model_to_dict(automation))
return auto_config return auto_config