Merge pull request #9443 from jumpserver/pr@dev@fix_execute_shell_chdir_invalid

fix: 解决执行命令作业指定当前路径的问题
This commit is contained in:
老广
2023-02-06 17:59:53 +08:00
committed by GitHub

View File

@@ -176,9 +176,7 @@ class JobExecution(JMSOrgBaseModel):
shell = self.current_job.args shell = self.current_job.args
if self.current_job.chdir: if self.current_job.chdir:
if module == self.current_job.module: if module == "shell":
shell += " path={}".format(self.current_job.chdir)
else:
shell += " chdir={}".format(self.current_job.chdir) shell += " chdir={}".format(self.current_job.chdir)
if self.current_job.module in ['python']: if self.current_job.module in ['python']:
shell += " executable={}".format(self.current_job.module) shell += " executable={}".format(self.current_job.module)