mirror of https://github.com/jumpserver/jumpserver
perf: 优化报错内容
parent
9e31a5064b
commit
2c2334b618
|
@ -32,7 +32,8 @@ class AdHocRunner:
|
|||
if self.module not in self.cmd_modules_choices:
|
||||
return
|
||||
if self.module_args and self.module_args.split()[0] in settings.SECURITY_COMMAND_BLACKLIST:
|
||||
raise CommandInBlackListException("command not allowed:{}".format(self.module_args.split()[0]))
|
||||
raise CommandInBlackListException(
|
||||
"Command is rejected by black list: {}".format(self.module_args.split()[0]))
|
||||
|
||||
def run(self, verbosity=0, **kwargs):
|
||||
self.check_module()
|
||||
|
|
|
@ -451,7 +451,7 @@ class JobExecution(JMSOrgBaseModel):
|
|||
self.set_result(cb)
|
||||
return cb
|
||||
except CommandInBlackListException as e:
|
||||
print("command is rejected by black list: {}".format(e))
|
||||
print(e)
|
||||
except Exception as e:
|
||||
logging.error(e, exc_info=True)
|
||||
self.set_error(e)
|
||||
|
|
Loading…
Reference in New Issue