perf: ansible accounts is_active (#9473)

Co-authored-by: feng <1304903146@qq.com>
pull/9474/head
fit2bot 2023-02-08 20:39:24 +08:00 committed by GitHub
parent e3d1474b9b
commit 7b9523d6be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -139,7 +139,9 @@ class JMSInventory:
return host
def select_account(self, asset):
accounts = list(asset.accounts.all())
accounts = list(asset.accounts.all(is_active=True))
if not accounts:
return None
account_selected = None
account_usernames = self.account_prefer