Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/extension/src/MsftLinuxPatchExtShim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function find_python(){
local python_exec_command=$1

# Check if there is python defined.
for p in python python2 python3 /usr/libexec/platform-python; do
for p in python3 python python2 /usr/libexec/platform-python; do
if command -v "${p}" ; then
eval ${python_exec_command}=${p}
return
Expand Down
10 changes: 5 additions & 5 deletions src/extension/src/ProcessHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ def get_python_cmd(self):
command_to_use_for_python = "python"
command_to_use_for_python3 = "python3"

# check if the machine contains python
code_returned_for_python_check, output_for_python_check = self.env_layer.run_command_output(command_to_check_for_python, False, False)
if code_returned_for_python_check == 0 and command_to_use_for_python in str(output_for_python_check) and command_to_use_for_python3 not in str(output_for_python_check):
return command_to_use_for_python

# check if the machine contains python3
code_returned_for_python3_check, output_for_python3_check = self.env_layer.run_command_output(command_to_check_for_python3, False, False)
if code_returned_for_python3_check == 0 and command_to_use_for_python3 in str(output_for_python3_check):
return command_to_use_for_python3

# check if the machine contains python
code_returned_for_python_check, output_for_python_check = self.env_layer.run_command_output(command_to_check_for_python, False, False)
if code_returned_for_python_check == 0 and command_to_use_for_python in str(output_for_python_check) and command_to_use_for_python3 not in str(output_for_python_check):
return command_to_use_for_python

return Constants.PYTHON_NOT_FOUND

def __check_process_state(self, process, seq_no):
Expand Down