perf: automation .account -> .all_accounts

This commit is contained in:
feng 2025-04-14 14:16:28 +08:00 committed by ZhaoJiSen
parent 3b2ac101c8
commit 2ca0e9a5a2
3 changed files with 3 additions and 3 deletions

View File

@ -69,7 +69,7 @@ class BaseChangeSecretPushManager(AccountBasePlaybookManager):
return return
asset = privilege_account.asset asset = privilege_account.asset
accounts = asset.accounts.all() accounts = asset.all_accounts.all()
accounts = accounts.filter(id__in=self.account_ids, secret_reset=True) accounts = accounts.filter(id__in=self.account_ids, secret_reset=True)
if self.secret_type: if self.secret_type:

View File

@ -42,7 +42,7 @@ class VerifyAccountManager(AccountBasePlaybookManager):
if host.get('error'): if host.get('error'):
return host return host
accounts = asset.accounts.all() accounts = asset.all_accounts.all()
accounts = self.get_accounts(account, accounts) accounts = self.get_accounts(account, accounts)
inventory_hosts = [] inventory_hosts = []

View File

@ -237,7 +237,7 @@ class JMSInventory:
return accounts_sorted return accounts_sorted
def get_asset_sorted_accounts(self, asset): def get_asset_sorted_accounts(self, asset):
accounts = list(asset.accounts.filter(is_active=True)) accounts = list(asset.all_accounts.filter(is_active=True))
accounts_sorted = self.sorted_accounts(accounts) accounts_sorted = self.sorted_accounts(accounts)
return accounts_sorted return accounts_sorted