perf: change domain to zone (#15255)

* perf: change domain to zone

* perf: change domain to zone

* perf: change some word

* perf: update gateway enabled i18n

* perf: change migrations

---------

Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
fit2bot
2025-04-21 10:30:18 +08:00
committed by GitHub
parent 57fcebfdd3
commit 3159a4e794
40 changed files with 178 additions and 143 deletions

View File

@@ -37,7 +37,7 @@ class JMSInventory:
from assets.models import Asset
asset_ids = [asset.id for asset in assets]
assets = Asset.objects.filter(id__in=asset_ids, is_active=True) \
.prefetch_related('platform', 'domain', 'accounts')
.prefetch_related('platform', 'zone', 'accounts')
return assets
@staticmethod
@@ -236,8 +236,8 @@ class JMSInventory:
host.update(ansible_config)
gateway = None
if not asset.is_gateway and asset.domain:
gateway = asset.domain.select_gateway()
if not asset.is_gateway and asset.zone:
gateway = asset.zone.select_gateway()
self.make_account_vars(
host, asset, account, automation, protocol, platform, gateway, path_dir, ansible_config