diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2016-05-10 11:51:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-05-10 11:51:18 +0000 |
commit | acd3d80504a56183a4909dce52b56bc7e15bc6cd (patch) | |
tree | 9c656eb5db5813865537cb1f0693564dbc38e32b /utils/functest_utils.py | |
parent | 7eeab2d73796b1054c20b41329835adc090bbf3c (diff) | |
parent | bd00e6f289a69badf7beea827b20764ed3252c7a (diff) |
Merge "CLI implementation"
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 41925fc4a..2d871615a 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: |