Fix 'task name is not templated in retry callback' (add task_name property to TaskResult) (#21214)

Fix 'task name is not templated in retry callback'

Add a task_name property to TaskResult that knows to
check in TaskResult._task_fields.

Add integration test for v2_retry_runner callback

Fixes #18236
This commit is contained in:
Adrian Likins 2017-02-24 12:33:24 -05:00 committed by GitHub
commit 8830cde28d
6 changed files with 56 additions and 2 deletions

View file

@ -21,6 +21,7 @@ __metaclass__ = type
from ansible.parsing.dataloader import DataLoader
class TaskResult:
'''
This class is responsible for interpreting the resulting data
@ -42,6 +43,10 @@ class TaskResult:
else:
self._task_fields = task_fields
@property
def task_name(self):
return self._task_fields.get('name', None) or self._task.get_name()
def is_changed(self):
return self._check_key('changed')