OSDN Git Service

Redirect subprocess stderr to stdout in verbose mode.
authorAlex Deymo <deymo@google.com>
Fri, 10 Jun 2016 23:38:31 +0000 (16:38 -0700)
committerAlex Deymo <deymo@google.com>
Fri, 10 Jun 2016 23:38:31 +0000 (16:38 -0700)
commitd8d96ecdaebbccc003a5de6a7b90661d4de016ab
treebfe259392281f3d3e374ea11d5dce52745b5dabd
parente5c1af2dd0bf003a2fdb6aedf0e635569f597a9a
Redirect subprocess stderr to stdout in verbose mode.

This patch uses subprocess.communicate instead of subprocess.wait to
prevent deadlock if any of the child processes outputs too much data,
and redirects the subprocess output to stdout when running in verbose
mode.

With this patch `ota_from_target_files -v` prints the delta_generator
output in stdout, and no output if '-v' is not passed.

Bug: None
TEST=ota_from_target_files -v ...

Change-Id: Id66e4f3360a6f91d61a3ce96d53afbccdaa19da5
tools/releasetools/ota_from_target_files.py