From ddca4dce41839bf298b33bdce826e4d5d2963895 Mon Sep 17 00:00:00 2001 From: Aaron3S Date: Tue, 27 Dec 2022 15:04:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81pyhton=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/models/job.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/ops/models/job.py b/apps/ops/models/job.py index 1b6a33b59..98ec9797f 100644 --- a/apps/ops/models/job.py +++ b/apps/ops/models/job.py @@ -165,12 +165,11 @@ class JobExecution(JMSOrgBaseModel): if self.current_job.type != 'adhoc': return result = self.current_job.args - result += " chdir={}".format(self.current_job.chdir) - + if self.current_job.chdir: + result += " chdir={}".format(self.current_job.chdir) if self.current_job.module in ['python']: result += " executable={}".format(self.current_job.module) - print(result) - return self.job.args + return result def get_runner(self): inv = self.current_job.inventory @@ -238,7 +237,7 @@ class JobExecution(JMSOrgBaseModel): @property def is_finished(self): - return self.status in [JobStatus.success, JobStatus.failed] + return self.status in [JobStatus.success, JobStatus.failed, JobStatus.timeout] @property def is_success(self):