+ def poll(self):
+ self.status = self.proc.poll()
+ return self.status
+
+ def kill(self):
+ if self.proc is not None:
+ run_cmd("killbysubdir %s > /dev/null 2>&1" % self.sdir, checkfail=False)
+ self.proc.terminate()
+ self.proc.wait()
+ self.proc = None
+
+ @property
+ def failed(self):
+ return (os.WIFSIGNALED(self.status) or os.WEXITSTATUS(self.status) != 0)
+
+ @property
+ def failure_reason(self):
+ return "%s: [%s] failed '%s' with status %d" % (self.name, self.stage, self.cmd, self.status)
+