issue #536: restore correct Python interpreter selection behaviour.

pull/564/head
David Wilson 6 years ago
parent 1d43e187e8
commit 001e3fee86

@ -329,9 +329,11 @@ class PlayContextSpec(Spec):
return self._play_context.port return self._play_context.port
def python_path(self): def python_path(self):
return parse_python_path( s = self._connection.get_task_var('ansible_python_interpreter')
self._connection.get_task_var('ansible_python_interpreter') # #511, #536: executor/module_common.py::_get_shebang() hard-wires
) # "/usr/bin/python" as the default interpreter path if no other
# interpreter is specified.
return parse_python_path(s or '/usr/bin/python')
def private_key_file(self): def private_key_file(self):
return self._play_context.private_key_file return self._play_context.private_key_file
@ -487,11 +489,12 @@ class MitogenViaSpec(Spec):
) )
def python_path(self): def python_path(self):
return parse_python_path( s = self._host_vars.get('ansible_python_interpreter')
self._host_vars.get('ansible_python_interpreter') # #511, #536: executor/module_common.py::_get_shebang() hard-wires
# This variable has no default for remote hosts. For local hosts it # "/usr/bin/python" as the default interpreter path if no other
# is sys.executable. # interpreter is specified.
) return parse_python_path(s or '/usr/bin/python')
def private_key_file(self): def private_key_file(self):
# TODO: must come from PlayContext too. # TODO: must come from PlayContext too.

Loading…
Cancel
Save