From 245b2e34fd7d265a1b02d594093808a7f37e76f4 Mon Sep 17 00:00:00 2001 From: noopur Date: Mon, 20 Jan 2025 15:19:11 +0000 Subject: [PATCH] Bandit issue - subprocess corrected Signed-off-by: noopur --- tests/end_to_end/utils/federation_helper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/end_to_end/utils/federation_helper.py b/tests/end_to_end/utils/federation_helper.py index dea463ad26..9a60ea8522 100644 --- a/tests/end_to_end/utils/federation_helper.py +++ b/tests/end_to_end/utils/federation_helper.py @@ -711,7 +711,8 @@ def download_data(collaborators, model_name, local_bind_path): log.info("Downloading the data for the model. This will take some time to complete based on the data size ..") try: - subprocess.run(f"cd {local_bind_path}; python {constants.DATA_SETUP_FILE} {len(collaborators)}", shell=True) # nosec B602 + command = ["python", constants.DATA_SETUP_FILE, str(len(collaborators))] + subprocess.run(command, cwd=local_bind_path, check=True) except Exception: raise ex.DataSetupException(f"Failed to download data for {model_name}")