mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-01-29 21:51:31 +00:00
fix: update translation strings and improve error handling in inventory and job modules
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from collections import defaultdict
|
||||
|
||||
import sys
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
__all__ = ['JMSInventory']
|
||||
@@ -319,7 +319,7 @@ class JMSInventory:
|
||||
else:
|
||||
runnable_hosts.append({
|
||||
'name': host['name'],
|
||||
'ip': host['ansible_host'],
|
||||
'ip': host.get('ansible_host', ''),
|
||||
'id': host.get('jms_asset', {}).get('id')
|
||||
})
|
||||
result = {
|
||||
|
||||
@@ -79,7 +79,7 @@ class JMSPermedInventory(JMSInventory):
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
if protocol.name in ('mariadb', 'mysql', 'postgresql', 'sqlserver'):
|
||||
|
||||
Reference in New Issue
Block a user