X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;ds=inline;f=tools%2Ftasks.py;h=9816a33694044d8e7042aa3fd2d0f7b5967476a1;hb=6c9279502beeeee90205488398001640103a522d;hp=dda5217d20c7116cb2e16af0b21d496bc1b3b4c9;hpb=6c888fd41de8889891c163d4757099aec84b34d8;p=vswitchperf.git 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: