fallback to old-style python interpreter default if running ansible < 2.8.0

This commit is contained in:
Steven Robertson 2020-02-05 15:34:47 -08:00
parent 1dddfadf32
commit 2d3d9cb659
1 changed files with 6 additions and 1 deletions

View File

@ -65,10 +65,15 @@ import os
import ansible.utils.shlex
import ansible.constants as C
from ansible.executor.interpreter_discovery import discover_interpreter
from ansible.module_utils.six import with_metaclass
from ansible.utils.unsafe_proxy import AnsibleUnsafeText
# this was added in Ansible >= 2.8.0; fallback to the default interpreter if necessary
try:
from ansible.executor.interpreter_discovery import discover_interpreter
except ModuleNotFoundError:
discover_interpreter = lambda a,b,c,d: '/usr/bin/python'
import mitogen.core