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

fix: 解决执行命令作业指定当前路径的问题
pull/9446/head
老广 2023-02-06 17:59:53 +08:00 committed by GitHub
commit 47f23a1b9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

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)