Remove exit() in ft_utils.execute_command 27/23027/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Wed, 12 Oct 2016 15:25:21 +0000 (17:25 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Wed, 12 Oct 2016 15:28:07 +0000 (17:28 +0200)
It simply removes the exit call in ft_utils.execute_command which is
quite safe as every testcase sets exit_on_error to False

JIRA: FUNCTEST-438

Change-Id: Ia273de0955cc3ea65a150c626638400ce614da00
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
ci/prepare_env.py
ci/run_tests.py
cli/commands/cli_os.py
testcases/features/copper.py
testcases/features/doctor.py
testcases/features/domino.py
testcases/vnf/vRNC/parser.py
utils/functest_utils.py

index 6b1baba..e110aa5 100755 (executable)
@@ -223,7 +223,7 @@ def install_rally():
     logger.info("Creating Rally environment...")
 
     cmd = "rally deployment destroy opnfv-rally"
-    ft_utils.execute_command(cmd, exit_on_error=False,
+    ft_utils.execute_command(cmd,
                              error_msg=("Deployment %s does not exist."
                                         % DEPLOYMENT_MAME), verbose=False)
     rally_conf = os_utils.get_credentials_for_rally()
index af8f51d..638a6ed 100755 (executable)
@@ -108,7 +108,7 @@ def run_test(test, tier_name):
     else:
         cmd = ("%s%s" % (EXEC_SCRIPT, flags))
         logger.debug("Executing command '%s'" % cmd)
-        result = ft_utils.execute_command(cmd, exit_on_error=False)
+        result = ft_utils.execute_command(cmd)
 
     if CLEAN_FLAG:
         cleanup()
index 4324ae4..3748c21 100644 (file)
@@ -47,7 +47,7 @@ class CliOpenStack:
 
     def show_credentials(self):
         cmd = "env|grep OS_"
-        ft_utils.execute_command(cmd, exit_on_error=False, verbose=False)
+        ft_utils.execute_command(cmd, verbose=False)
         click.echo("")
 
     def fetch_credentials(self):
index be6744a..ab01626 100755 (executable)
@@ -43,7 +43,6 @@ def main():
 
     log_file = RESULTS_DIR + "/copper.log"
     ret_val = functest_utils.execute_command(cmd,
-                                             exit_on_error=False,
                                              output_file=log_file)
 
     stop_time = time.time()
index 6c26875..00e5c1d 100755 (executable)
@@ -52,7 +52,6 @@ def main():
 
     ret = functest_utils.execute_command(cmd,
                                          info=True,
-                                         exit_on_error=False,
                                          output_file=log_file)
 
     stop_time = time.time()
index 75351a5..7705c07 100755 (executable)
@@ -42,7 +42,6 @@ def main():
     start_time = time.time()
 
     ret = ft_utils.execute_command(cmd,
-                                   exit_on_error=False,
                                    output_file=log_file)
 
     stop_time = time.time()
index 0320b10..0381fd6 100755 (executable)
@@ -44,7 +44,6 @@ def main():
     log_file = RESULTS_DIR + "/parser.log"
     ret = functest_utils.execute_command(cmd,
                                          info=True,
-                                         exit_on_error=False,
                                          output_file=log_file)
     stop_time = time.time()
 
index 717e4b2..ef865be 100644 (file)
@@ -289,7 +289,7 @@ def get_ci_envvars():
     return ci_env_var
 
 
-def execute_command(cmd, exit_on_error=True, info=False, error_msg="",
+def execute_command(cmd, info=False, error_msg="",
                     verbose=True, output_file=None):
     if not error_msg:
         error_msg = ("The command '%s' failed." % cmd)
@@ -317,8 +317,6 @@ def execute_command(cmd, exit_on_error=True, info=False, error_msg="",
     if returncode != 0:
         if verbose:
             logger.error(error_msg)
-        if exit_on_error:
-            sys.exit(1)
 
     return returncode