mirror of https://github.com/jumpserver/jumpserver
fix: 解决没获取到证书的mongodb导致的无法执行自动化任务 (#9399)
parent
f68dde456d
commit
3080771559
|
@ -73,7 +73,7 @@ class BasePlaybookManager:
|
|||
if not path_dir:
|
||||
return host
|
||||
|
||||
specific = host.get('jms_asset', {}).get('specific', {})
|
||||
specific = host.get('jms_asset', {}).get('secret_info', {})
|
||||
cert_fields = ('ca_cert', 'client_key', 'client_cert')
|
||||
filtered = list(filter(lambda x: specific.get(x), cert_fields))
|
||||
if not filtered:
|
||||
|
@ -87,7 +87,7 @@ class BasePlaybookManager:
|
|||
result = self.write_cert_to_file(
|
||||
os.path.join(cert_dir, f), specific.get(f)
|
||||
)
|
||||
host['jms_asset']['specific'][f] = result
|
||||
host['jms_asset']['secret_info'][f] = result
|
||||
return host
|
||||
|
||||
def host_callback(self, host, automation=None, **kwargs):
|
||||
|
|
|
@ -105,7 +105,7 @@ class JMSInventory:
|
|||
'id': str(asset.id), 'name': asset.name, 'address': asset.address,
|
||||
'type': asset.type, 'category': asset.category,
|
||||
'protocol': asset.protocol, 'port': asset.port,
|
||||
'spec_info': asset.spec_info,
|
||||
'spec_info': asset.spec_info, 'secret_info': asset.secret_info,
|
||||
'protocols': [{'name': p.name, 'port': p.port} for p in protocols],
|
||||
},
|
||||
'jms_account': {
|
||||
|
|
Loading…
Reference in New Issue