mirror of https://github.com/jumpserver/jumpserver
feat: 支持pyhton脚本
parent
1b9aad594c
commit
ddca4dce41
|
@ -165,12 +165,11 @@ class JobExecution(JMSOrgBaseModel):
|
||||||
if self.current_job.type != 'adhoc':
|
if self.current_job.type != 'adhoc':
|
||||||
return
|
return
|
||||||
result = self.current_job.args
|
result = self.current_job.args
|
||||||
|
if self.current_job.chdir:
|
||||||
result += " chdir={}".format(self.current_job.chdir)
|
result += " chdir={}".format(self.current_job.chdir)
|
||||||
|
|
||||||
if self.current_job.module in ['python']:
|
if self.current_job.module in ['python']:
|
||||||
result += " executable={}".format(self.current_job.module)
|
result += " executable={}".format(self.current_job.module)
|
||||||
print(result)
|
return result
|
||||||
return self.job.args
|
|
||||||
|
|
||||||
def get_runner(self):
|
def get_runner(self):
|
||||||
inv = self.current_job.inventory
|
inv = self.current_job.inventory
|
||||||
|
@ -238,7 +237,7 @@ class JobExecution(JMSOrgBaseModel):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_finished(self):
|
def is_finished(self):
|
||||||
return self.status in [JobStatus.success, JobStatus.failed]
|
return self.status in [JobStatus.success, JobStatus.failed, JobStatus.timeout]
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_success(self):
|
def is_success(self):
|
||||||
|
|
Loading…
Reference in New Issue