From c7edada4ccf84851b76b9ef738c270a7a6819a06 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Mon, 29 Aug 2016 21:24:52 +0200 Subject: Flush stdout as it can be redirected to log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It avoids mixed logs in Jenkins' console by flushing every message printed by the forked programs as logger.info() does. It must be complete by refactoring logger management in util functions [1] and by preventing output buffering in forked programs. [1] https://jira.opnfv.org/browse/FUNCTEST-428 JIRA: FUNCTEST-441 Change-Id: Id8da814d79ea6b1e6b91b49e23a85c3802e11515 Signed-off-by: Cédric Ollivier --- utils/functest_utils.py | 1 + 1 file changed, 1 insertion(+) (limited to 'utils/functest_utils.py') diff --git a/utils/functest_utils.py b/utils/functest_utils.py index 02e7d3d84..199088b9c 100644 --- a/utils/functest_utils.py +++ b/utils/functest_utils.py @@ -339,6 +339,7 @@ def execute_command(cmd, logger=None, logger.debug(line) else: print line + sys.stdout.flush() p.stdout.close() returncode = p.wait() if returncode != 0: -- cgit 1.2.3-korg