@@ -121,7 +121,7 @@ def call_cmd(self, cmd, cwd):
121121 f .write (str (cmd ))
122122 stdout = open (self .outfile , "w" )
123123 stderr = open (self .errfile , "w" )
124- logging .info ("Calling: " + " " .join (cmd ))
124+ logging .info ("Calling: %s, with outfile: %s and errfile: %s" , ( " " .join (cmd )), self . outfile , self . errfile )
125125 process = subprocess .Popen (
126126 cmd , stdout = stdout , stderr = stderr , close_fds = True , cwd = cwd
127127 )
@@ -267,18 +267,15 @@ def getstate(self):
267267 logging .info ("Workflow " + self .run_id + ": INITIALIZING" )
268268 return "INITIALIZING" , - 1
269269
270- # TODO: Query with "toil status"
271270 completed = False
272271 with open (self .errfile ) as f :
273272 for line in f :
274273 if "Traceback (most recent call last)" in line :
275274 logging .info ("Workflow " + self .run_id + ": EXECUTOR_ERROR" )
276275 open (self .staterrorfile , "a" ).close ()
277276 return "EXECUTOR_ERROR" , 255
278- # run can complete successfully but fail to upload outputs to cloud buckets
279- # so save the completed status and make sure there was no error elsewhere
280- if "Finished toil run successfully." in line :
281- completed = True
277+ if subprocess .run (["toil" , "status" , "--failIfNotComplete" , self .jobstorefile ]).returncode == 0 :
278+ completed = True
282279 if completed :
283280 logging .info ("Workflow " + self .run_id + ": COMPLETE" )
284281 open (self .statcompletefile , "a" ).close ()
0 commit comments