diff --git a/pyproject.toml b/pyproject.toml index 08cc59c..9cc619d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "redisbench-admin" -version = "0.10.7" +version = "0.10.8" description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )." authors = ["filipecosta90 ","Redis Performance Group "] readme = "README.md" diff --git a/redisbench_admin/run/modules.py b/redisbench_admin/run/modules.py index e0e4010..2ce06b4 100644 --- a/redisbench_admin/run/modules.py +++ b/redisbench_admin/run/modules.py @@ -15,19 +15,36 @@ def redis_modules_check(local_module_files): "Using the following module artifacts: {}".format(local_module_files) ) for local_module_file in local_module_files: - logging.info( - "Checking if module artifact {} exists...".format(local_module_file) - ) - if os.path.exists(local_module_file) is False: - error_message = "Specified module artifact does not exist: {}".format( - local_module_file - ) - logging.error(error_message) - status = False - else: + if type(local_module_file) is str: logging.info( - "Confirmed that module artifact: '{}' exists!".format( - local_module_file - ) + "Checking if module artifact {} exists...".format(local_module_file) + ) + error_message, status = exists_check( + error_message, local_module_file, status ) + if type(local_module_file) is list: + for inner_local_module_file in local_module_file: + logging.info( + "Checking if module artifact {} exists...".format( + inner_local_module_file + ) + ) + error_message, status = exists_check( + error_message, inner_local_module_file, status + ) + return status, error_message + + +def exists_check(error_message, local_module_file, status): + if os.path.exists(local_module_file) is False: + error_message = "Specified module artifact does not exist: {}".format( + local_module_file + ) + logging.error(error_message) + status = False + else: + logging.info( + "Confirmed that module artifact: '{}' exists!".format(local_module_file) + ) + return error_message, status diff --git a/redisbench_admin/run_remote/run_remote.py b/redisbench_admin/run_remote/run_remote.py index 6ea6af6..111b957 100644 --- a/redisbench_admin/run_remote/run_remote.py +++ b/redisbench_admin/run_remote/run_remote.py @@ -121,6 +121,12 @@ def run_remote_command_logic(args, project_name, project_version): tf_setup_name_sufix = "{}-{}".format(args.setup_name_sufix, tf_github_sha) s3_bucket_name = args.s3_bucket_name local_module_files = args.module_path + for pos, module_file in enumerate(local_module_files): + if " " in module_file: + logging.info( + "Detected multiple files in single module path {}".format(module_file) + ) + local_module_files[pos] = module_file.split(" ") dbdir_folder = args.dbdir_folder private_key = args.private_key grafana_profile_dashboard = args.grafana_profile_dashboard diff --git a/redisbench_admin/run_remote/standalone.py b/redisbench_admin/run_remote/standalone.py index 1657bbc..c76440f 100644 --- a/redisbench_admin/run_remote/standalone.py +++ b/redisbench_admin/run_remote/standalone.py @@ -76,7 +76,11 @@ def remote_module_files_cp( remote_module_files = [] if local_module_files is not None: for local_module_file in local_module_files: - splitted_module_and_plugins = local_module_file.split(" ") + splitted_module_and_plugins = [] + if type(local_module_file) is str: + splitted_module_and_plugins = local_module_file.split(" ") + if type(local_module_file) is list: + splitted_module_and_plugins = local_module_file if len(splitted_module_and_plugins) > 1: logging.info( "Detected a module and plugin(s) pairs {}".format(