(re)allow ansible_python_interpreter to contain more than 1 arg (#16247)

pull/16838/head
Lukas Pirl 8 years ago committed by Toshio Kuratomi
parent 92870ee996
commit a9aea3c6d4

@ -641,15 +641,10 @@ def _find_snippet_imports(module_name, module_data, module_path, module_args, ta
if shebang is None: if shebang is None:
shebang = u'#!/usr/bin/python' shebang = u'#!/usr/bin/python'
executable = interpreter.split(u' ', 1) # Enclose the parts of the interpreter in quotes because we're
if len(executable) == 2 and executable[0].endswith(u'env'): # substituting it into the template as a Python string
# Handle /usr/bin/env python style interpreter settings interpreter_parts = interpreter.split(u' ')
interpreter = u"'{0}', '{1}'".format(*executable) interpreter = u"'{0}'".format(u"', '".join(interpreter_parts))
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)
output.write(to_bytes(ACTIVE_ANSIBALLZ_TEMPLATE % dict( output.write(to_bytes(ACTIVE_ANSIBALLZ_TEMPLATE % dict(
zipdata=zipdata, zipdata=zipdata,

Loading…
Cancel
Save