mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-12 13:31:56 +00:00
perf: 主机名包含/ 可以执行ansible任务 (#11772)
Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# ~*~ coding: utf-8 ~*~
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
from collections import defaultdict
|
||||
|
||||
from django.utils.translation import gettext as _
|
||||
@@ -159,7 +160,7 @@ class JMSInventory:
|
||||
protocol = self.get_primary_protocol(ansible_config, protocols)
|
||||
|
||||
tp, category = asset.type, asset.category
|
||||
name = asset.name.replace(' ', '_').replace('[', '_').replace(']', '_')
|
||||
name = re.sub(r'[ \[\]/]', '_', asset.name)
|
||||
secret_info = {k: v for k, v in asset.secret_info.items() if v}
|
||||
host = {
|
||||
'name': name,
|
||||
|
Reference in New Issue
Block a user