Merge pull request #11302 from jumpserver/pr@dev@fix_ops_shell_run_failed

fix: 修复 shell 批量命令无法执行的问题
This commit is contained in:
老广 2023-08-16 18:43:35 +08:00 committed by GitHub
commit eb8d80d417
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,7 +60,14 @@ class JMSPermedInventory(JMSInventory):
host['error'] = _("No account available") host['error'] = _("No account available")
return host 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) host['error'] = "Module {} is not suitable for this asset".format(self.module)
return host return host