From 0a09ecbcaefbc03f2a2bb9157be05007100aee90 Mon Sep 17 00:00:00 2001 From: helenyao Date: Wed, 15 Feb 2017 21:04:34 -0500 Subject: Prepare env will exit when an error is raised JIRA: FUNCTEST-727 Change-Id: I4d8e24c0cb6272d92dc777dc82d56490948598db Signed-off-by: helenyao --- functest/utils/functest_utils.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'functest/utils/functest_utils.py') diff --git a/functest/utils/functest_utils.py b/functest/utils/functest_utils.py index b2c36cff9..78831c113 100644 --- a/functest/utils/functest_utils.py +++ b/functest/utils/functest_utils.py @@ -291,6 +291,13 @@ def get_ci_envvars(): return ci_env_var +def execute_command_raise(cmd, info=False, error_msg="", + verbose=True, output_file=None): + ret = execute_command(cmd, info, error_msg, verbose, output_file) + if ret != 0: + raise Exception(error_msg) + + def execute_command(cmd, info=False, error_msg="", verbose=True, output_file=None): if not error_msg: -- cgit 1.2.3-korg