Skip to content

Commit

Permalink
remove duplicate function
Browse files Browse the repository at this point in the history
  • Loading branch information
jsonar-cpapke committed Feb 5, 2024
1 parent 25f03ae commit 069d4ac
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions modules/aws/sonar-upgrader/python_upgrader/upgrade/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down

0 comments on commit 069d4ac

Please sign in to comment.