Skip to content

Commit

Permalink
(re)allow ansible_python_interpreter to contain more than 1 arg (#16247)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpirl authored and abadger committed Jul 26, 2016
1 parent 92870ee commit a9aea3c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lib/ansible/executor/module_common.py
Expand Up @@ -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,
Expand Down

0 comments on commit a9aea3c

Please sign in to comment.