aboutsummaryrefslogtreecommitdiffstats
path: root/utils/functest_utils.py
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-05-10 11:51:18 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-05-10 11:51:18 +0000
commitacd3d80504a56183a4909dce52b56bc7e15bc6cd (patch)
tree9c656eb5db5813865537cb1f0693564dbc38e32b /utils/functest_utils.py
parent7eeab2d73796b1054c20b41329835adc090bbf3c (diff)
parentbd00e6f289a69badf7beea827b20764ed3252c7a (diff)
Merge "CLI implementation"
Diffstat (limited to 'utils/functest_utils.py')
-rw-r--r--utils/functest_utils.py20
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: