Put shell snippets into task.shell.cmd

Putting them directly into shell: breaks here docs. We can also use
the same dict for setting executable.

Change-Id: I050a17085f342e5765215bcde140649a9c740773
This commit is contained in:
Monty Taylor 2017-09-22 09:57:56 -05:00
parent 8f68fcc3ae
commit 2bd6b001e8
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 4 additions and 2 deletions

View File

@ -657,9 +657,11 @@ class Job:
def _emitShellTask(self, data, syntax_check):
shell, data = deal_with_shebang(data)
task = collections.OrderedDict()
task['shell'] = data
# Putting the data directly into shell: causes here docs to break.
task['shell'] = collections.OrderedDict()
task['shell']['cmd'] = data
if shell:
task['args'] = dict(executable=shell)
task['shell']['executable'] = shell
if syntax_check:
# Emit a test playbook with this shell task in it then run