fix: 解决没获取到证书的mongodb导致的无法执行自动化任务 (#9399)

pull/9401/head
jiangweidong 2023-02-02 10:32:48 +08:00 committed by GitHub
parent f68dde456d
commit 3080771559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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):

View File

@ -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': {