fix: 修复 shell 批量命令无法执行的问题

pull/11302/head
Aaron3S 2023-08-16 17:01:15 +08:00
parent 8f10b84e94
commit af9f7060be
1 changed files with 8 additions and 1 deletions

View File

@ -60,7 +60,14 @@ class JMSPermedInventory(JMSInventory):
host['error'] = _("No account available")
return host
if protocol.name != self.module:
protocol_supported_modules_mapping = {
'mysql': ['mysql'],
'postgresql': ['postgresql'],
'sqlserver': ['sqlserver'],
'ssh': ['shell', 'python', 'win_shell'],
}
if self.module not in protocol_supported_modules_mapping.get(protocol.name, []):
host['error'] = "Module {} is not suitable for this asset".format(self.module)
return host