From 069d4acfe5fdebf6ded043afbc79dbb20b275544 Mon Sep 17 00:00:00 2001 From: Christopher Papke Date: Mon, 5 Feb 2024 14:47:47 -0800 Subject: [PATCH] remove duplicate function --- .../sonar-upgrader/python_upgrader/upgrade/main.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/modules/aws/sonar-upgrader/python_upgrader/upgrade/main.py b/modules/aws/sonar-upgrader/python_upgrader/upgrade/main.py index e3fa327ac..869e52a61 100644 --- a/modules/aws/sonar-upgrader/python_upgrader/upgrade/main.py +++ b/modules/aws/sonar-upgrader/python_upgrader/upgrade/main.py @@ -473,7 +473,7 @@ def run_preflight_validations_script(args, dsf_node, dsf_node_name, python_locat script_output = run_remote_script_maybe_with_proxy(dsf_node, script_contents, script_run_command) print(f"'Run preflight validations' python script output:\n{script_output}") - preflight_validations_result = json.loads(script_output) + preflight_validations_result = json.loads(extract_preflight_validations_result(script_output)) print(f"Preflight validations result in {dsf_node_name} is {preflight_validations_result}") return preflight_validations_result @@ -500,17 +500,6 @@ def extract_python_location(script_output): raise Exception("Pattern 'Python location: ...' not found in 'Get python location' script output") -def run_preflight_validations_script(dsf_node, target_version, python_location, script_file_name): - script_file_path = build_script_file_path(script_file_name) - script_contents = read_file_contents(script_file_path) - script_run_command = build_python_script_run_command(script_contents, target_version, python_location) - # print(f"script_run_command: {script_run_command}") - - script_output = run_remote_script_maybe_with_proxy(dsf_node, script_contents, script_run_command) - print(f"'Run preflight validations' python script output:\n{script_output}") - return extract_preflight_validations_result(script_output) - - def extract_preflight_validations_result(script_output): pattern = r'Preflight validations result: ({.+})' match = re.search(pattern, script_output)