diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2016-05-06 01:36:30 +0200 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2016-05-09 16:58:04 +0200 |
commit | bd00e6f289a69badf7beea827b20764ed3252c7a (patch) | |
tree | 77cfd39903e5ebf9ea492737a499ef57346cd3f1 /utils/functest_utils.py | |
parent | 073ca5525f38d7a7c9c67252d1b996e895ff9917 (diff) |
CLI implementation
JIRA: FUNCTEST-243
Change-Id: Ibf0ef9bcc5f3aeda96b050827b954ce060317613
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
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: |