mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-01-26 13:25:10 +00:00
@@ -1,6 +1,7 @@
|
||||
# ~*~ coding: utf-8 ~*~
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
from collections import defaultdict
|
||||
|
||||
from django.utils.translation import gettext as _
|
||||
@@ -117,8 +118,10 @@ class JMSInventory:
|
||||
host.update(ansible_config)
|
||||
|
||||
gateway = None
|
||||
if asset.domain:
|
||||
gateway = asset.domain.select_gateway()
|
||||
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 ansible_connection == 'local':
|
||||
if gateway:
|
||||
|
||||
Reference in New Issue
Block a user