fix: 修复作业中心资产和用于没有过滤授权规则的问题

This commit is contained in:
Aaron3S
2023-02-22 15:35:59 +08:00
parent ee3c548b6b
commit d9a11900a9
3 changed files with 80 additions and 4 deletions

View File

@@ -139,8 +139,11 @@ class JMSInventory:
self.make_ssh_account_vars(host, asset, account, automation, protocols, platform, gateway)
return host
def get_asset_accounts(self, asset):
return list(asset.accounts.filter(is_active=True))
def select_account(self, asset):
accounts = list(asset.accounts.filter(is_active=True))
accounts = self.get_asset_accounts(asset)
if not accounts:
return None
account_selected = None