diff options
Diffstat (limited to 'utils/functest_utils.py')
-rw-r--r-- | utils/functest_utils.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/utils/functest_utils.py b/utils/functest_utils.py index 41925fc4..2d871615 100644 --- a/utils/functest_utils.py +++ b/utils/functest_utils.py @@ -213,16 +213,18 @@ def execute_command(cmd, logger=None, else: print(msg_exec) p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) - while p.poll() is None: - line = p.stdout.readline().rstrip() - if verbose: - if logger: - if info: - logger.info(line) - else: - logger.debug(line) + while True: + line = p.stdout.readline().replace('\n', '') + if not line: + break + if logger: + if info: + logger.info(line) else: - print line + logger.debug(line) + else: + print line + p.communicate() if p.returncode != 0: if verbose: if logger: |