diff options
author | Maryam Tahhan <maryam.tahhan@intel.com> | 2016-05-18 14:23:04 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-05-18 14:23:04 +0000 |
commit | cc5df3ec2038249425c8313bdb73add3d1268b09 (patch) | |
tree | b4aae66f5541037b13a0c4796d2fc7e6ba57dc38 | |
parent | ede959e96cd75f3405570d5eed549135ae98abec (diff) | |
parent | 419daef1a844be5fccb0d8f10a299279586d1cbd (diff) |
Merge "run_task_fix: Fix run_task to provide all output from command"
-rw-r--r-- | tools/tasks.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/tasks.py b/tools/tasks.py index dda5217d..9816a336 100644 --- a/tools/tasks.py +++ b/tools/tasks.py @@ -86,17 +86,24 @@ def run_task(cmd, logger, msg=None, check_error=False): for file_d in ret[0]: if file_d == proc.stdout.fileno(): - line = proc.stdout.readline() - if settings.getValue('VERBOSITY') == 'debug': - sys.stdout.write(line.decode(my_encoding)) - stdout.append(line) + while True: + line = proc.stdout.readline() + if not line: + break + if settings.getValue('VERBOSITY') == 'debug': + sys.stdout.write(line.decode(my_encoding)) + stdout.append(line) if file_d == proc.stderr.fileno(): - line = proc.stderr.readline() - sys.stderr.write(line.decode(my_encoding)) - stderr.append(line) + while True: + line = proc.stderr.readline() + if not line: + break + sys.stderr.write(line.decode(my_encoding)) + stderr.append(line) if proc.poll() is not None: break + except OSError as ex: handle_error(ex) else: |