in cstar/jobrunner.py [0:0]
def __call__(self):
replaced = self.job.command.replace("{}", self.host.ip)
# Use subprocess.Popen because subprocess.run is not available in Python 3.4 used by Ubuntu Trusty
proc = subprocess.Popen(shlex.split(replaced), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
try:
outs, errs = proc.communicate()
except subprocess.TimeoutExpired:
# The child process is not killed in case of timeout
proc.kill()
outs, errs = proc.communicate()
result = ExecutionResult(replaced, proc.returncode, str(outs, 'utf-8'), str(errs, 'utf-8'))
save_output(self.job, self.host, result)
self.job.results.put((self.host, result))
return result