@@ -199,29 +199,29 @@ def getstate(self):
199
199
state = "RUNNING"
200
200
exit_code = - 1
201
201
202
- exitcode_file = os .path .join (self .workdir , "exit_code" )
203
-
204
- if os .path .exists (exitcode_file ):
205
- with open (exitcode_file ) as f :
206
- exit_code = int (f .read ())
207
- elif os .path .exists (self .pidfile ):
208
- with open (self .pidfile , "r" ) as pid :
209
- pid = int (pid .read ())
210
- try :
211
- (_pid , exit_status ) = os .waitpid (pid , os .WNOHANG )
212
- if _pid != 0 :
213
- exit_code = exit_status >> 8
214
- with open (exitcode_file , "w" ) as f :
215
- f .write (str (exit_code ))
216
- os .unlink (self .pidfile )
217
- except OSError :
218
- os .unlink (self .pidfile )
219
- exit_code = 255
220
-
221
- if exit_code == 0 :
222
- state = "COMPLETE"
223
- elif exit_code != - 1 :
224
- state = "EXECUTOR_ERROR"
202
+ # exitcode_file = os.path.join(self.workdir, "exit_code")
203
+ #
204
+ # if os.path.exists(exitcode_file):
205
+ # with open(exitcode_file) as f:
206
+ # exit_code = int(f.read())
207
+ # elif os.path.exists(self.pidfile):
208
+ # with open(self.pidfile, "r") as pid:
209
+ # pid = int(pid.read())
210
+ # try:
211
+ # (_pid, exit_status) = os.waitpid(pid, os.WNOHANG)
212
+ # if _pid != 0:
213
+ # exit_code = exit_status >> 8
214
+ # with open(exitcode_file, "w") as f:
215
+ # f.write(str(exit_code))
216
+ # os.unlink(self.pidfile)
217
+ # except OSError:
218
+ # os.unlink(self.pidfile)
219
+ # exit_code = 255
220
+ #
221
+ # if exit_code == 0:
222
+ # state = "COMPLETE"
223
+ # elif exit_code != -1:
224
+ # state = "EXECUTOR_ERROR"
225
225
226
226
return state , exit_code
227
227
0 commit comments