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()
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()
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):
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()
ret = functest_utils.execute_command(cmd,
info=True,
- exit_on_error=False,
output_file=log_file)
stop_time = time.time()
start_time = time.time()
ret = ft_utils.execute_command(cmd,
- exit_on_error=False,
output_file=log_file)
stop_time = time.time()
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()
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)
if returncode != 0:
if verbose:
logger.error(error_msg)
- if exit_on_error:
- sys.exit(1)
return returncode