summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Pirl <github@lukas-pirl.de>2016-07-26 16:46:16 +0200
committerToshio Kuratomi <toshio@fedoraproject.org>2016-07-26 07:47:49 -0700
commitafc408abde3b5e943a7682fe4fe52e56888ca9b2 (patch)
tree53d0dc0c158c3a90c22e8cbe9a9c4c72780ee4b3
parent8d58d3ffa6d0f01257b38183d0cfb1f8e7593696 (diff)
downloadansible-tmp-holding-branch-post-2.1.1.tar.gz
(re)allow ansible_python_interpreter to contain more than 1 arg (#16247)tmp-holding-branch-post-2.1.1
-rw-r--r--lib/ansible/executor/module_common.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/ansible/executor/module_common.py b/lib/ansible/executor/module_common.py
index c057d670e5..6b29d8df03 100644
--- a/lib/ansible/executor/module_common.py
+++ b/lib/ansible/executor/module_common.py
@@ -626,15 +626,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_ZIPLOADER_TEMPLATE % dict(
zipdata=zipdata,