mirror of https://github.com/jumpserver/jumpserver
[Bugfix] 修复任务执行args为空的bug
parent
a99d5609fa
commit
55ff82545a
|
@ -165,6 +165,8 @@ class AdHocRunner:
|
|||
)
|
||||
|
||||
def clean_args(self, module, args):
|
||||
if not args:
|
||||
return ''
|
||||
if module not in self.command_modules_choices:
|
||||
return args
|
||||
if isinstance(args, str):
|
||||
|
|
|
@ -229,7 +229,7 @@ class AdHoc(models.Model):
|
|||
history.result = raw
|
||||
history.summary = summary
|
||||
return raw, summary
|
||||
except IndexError as e:
|
||||
except Exception as e:
|
||||
return {}, {"dark": {"all": str(e)}, "contacted": []}
|
||||
finally:
|
||||
# f.close()
|
||||
|
|
Loading…
Reference in New Issue