mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-13 05:49:07 +00:00
perf: del domain node
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
# ~*~ coding: utf-8 ~*~
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
from collections import defaultdict
|
||||
|
||||
from django.utils.translation import gettext as _
|
||||
@@ -118,10 +117,8 @@ class JMSInventory:
|
||||
host.update(ansible_config)
|
||||
|
||||
gateway = None
|
||||
domains = asset.get_domains()
|
||||
if domains:
|
||||
gateways = [i.select_gateway() for i in domains if i.select_gateway()]
|
||||
gateway = random.choice(gateways) if gateways else None
|
||||
if asset.domain:
|
||||
gateway = asset.domain.select_gateway()
|
||||
|
||||
if ansible_connection == 'local':
|
||||
if gateway:
|
||||
|
Reference in New Issue
Block a user