mirror of https://github.com/jumpserver/jumpserver
fix: 修复批量执行命令时资产名称包含 [ 特殊字符执行报错的问题(issue: 10986)
parent
de5b501ebf
commit
8ed3da85f2
|
@ -268,6 +268,7 @@ class JMSInventory:
|
|||
data = {'all': {'hosts': {}}}
|
||||
for host in hosts:
|
||||
name = host.pop('name')
|
||||
name = name.replace('[', '_').replace(']', '_')
|
||||
data['all']['hosts'][name] = host
|
||||
if self.exclude_localhost and data['all']['hosts'].__contains__('localhost'):
|
||||
data['all']['hosts'].update({'localhost': {'ansible_host': '255.255.255.255'}})
|
||||
|
|
Loading…
Reference in New Issue