diff options
author | Lukas Pirl <github@lukas-pirl.de> | 2016-07-26 16:46:16 +0200 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-07-26 07:46:16 -0700 |
commit | a9aea3c6d4d1e76ed9b9afb372e75ee55f53ede4 (patch) | |
tree | dc4028fcc49ba11ee20e8ce87be6856a6ede62c2 /lib/ansible/executor | |
parent | 92870ee996174f8d70824170aa6a3e078399f65a (diff) | |
download | ansible-a9aea3c6d4d1e76ed9b9afb372e75ee55f53ede4.tar.gz |
(re)allow ansible_python_interpreter to contain more than 1 arg (#16247)
Diffstat (limited to 'lib/ansible/executor')
-rw-r--r-- | lib/ansible/executor/module_common.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/ansible/executor/module_common.py b/lib/ansible/executor/module_common.py index 23954a3e91..9ce6eb0511 100644 --- a/lib/ansible/executor/module_common.py +++ b/lib/ansible/executor/module_common.py @@ -641,15 +641,10 @@ def _find_snippet_imports(module_name, module_data, module_path, module_args, ta if shebang is None: shebang = u'#!/usr/bin/python' - executable = interpreter.split(u' ', 1) - if len(executable) == 2 and executable[0].endswith(u'env'): - # Handle /usr/bin/env python style interpreter settings - interpreter = u"'{0}', '{1}'".format(*executable) - else: - # Still have to enclose the parts of the interpreter in quotes - # because we're substituting it into the template as a python - # string - interpreter = u"'{0}'".format(interpreter) + # Enclose the parts of the interpreter in quotes because we're + # substituting it into the template as a Python string + interpreter_parts = interpreter.split(u' ') + interpreter = u"'{0}'".format(u"', '".join(interpreter_parts)) output.write(to_bytes(ACTIVE_ANSIBALLZ_TEMPLATE % dict( zipdata=zipdata, |