Previously we were returning from this method before the process had actually
finished, introducing issues where we relied on process actually finishing or
simply not returning all the data the process was going to produce.
pipe = subprocess.Popen(cmd, shell=True, universal_newlines=True,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- output = "".join(pipe.stdout.readlines())
+ output, _ = pipe.communicate()
if output[-1:] == '\n':
output = output[:-1]