@ -9,6 +9,7 @@
from __future__ import absolute_import , division , print_function
from __future__ import absolute_import , division , print_function
__metaclass__ = type
__metaclass__ = type
import platform
import sys
import sys
from ansible . module_utils . basic import AnsibleModule
from ansible . module_utils . basic import AnsibleModule
@ -23,7 +24,12 @@ def main():
result [ ' ansible_facts ' ] = module . params [ ' facts ' ]
result [ ' ansible_facts ' ] = module . params [ ' facts ' ]
# revert the Mitogen OSX tweak since discover_interpreter() doesn't return this info
# revert the Mitogen OSX tweak since discover_interpreter() doesn't return this info
if sys . platform == ' darwin ' and sys . executable != ' /usr/bin/python ' :
if sys . platform == ' darwin ' and sys . executable != ' /usr/bin/python ' :
if int ( platform . release ( ) [ : 2 ] ) < 19 :
sys . executable = sys . executable [ : - 3 ]
sys . executable = sys . executable [ : - 3 ]
else :
# only for tests to check version of running interpreter -- Mac 10.15+ changed python2
# so it looks like it's /usr/bin/python but actually it's /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
sys . executable = " /usr/bin/python "
result [ ' running_python_interpreter ' ] = sys . executable
result [ ' running_python_interpreter ' ] = sys . executable
module . exit_json ( * * result )
module . exit_json ( * * result )