Skip to content

Commit

Permalink
[2.7] Exclude the whole ansible_failed_task block (ansible#45587)
Browse files Browse the repository at this point in the history
It has lots of FieldAttributes that won't serialize.
Also the connection doesn't care.
(cherry picked from commit 3d0f19d)

Co-authored-by: Nathaniel Case <[email protected]>
  • Loading branch information
Qalthos authored and abadger committed Sep 13, 2018
1 parent 25349b8 commit b52148d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ansible/executor/task_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,10 @@ def _get_connection(self, variables, templar):
display.vvvv('attempting to start connection', host=self._play_context.remote_addr)
display.vvvv('using connection plugin %s' % connection.transport, host=self._play_context.remote_addr)
# We don't need to send the entire contents of variables to ansible-connection
filtered_vars = dict((key, value) for key, value in variables.items() if key.startswith('ansible'))
filtered_vars = dict(
(key, value) for key, value in variables.items()
if key.startswith('ansible') and key != 'ansible_failed_task'
)
socket_path = self._start_connection(filtered_vars)
display.vvvv('local domain socket path is %s' % socket_path, host=self._play_context.remote_addr)
setattr(connection, '_socket_path', socket_path)
Expand Down

0 comments on commit b52148d

Please sign in to comment.