mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-31 00:51:23 -07:00
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:
parent
78c4f03e50
commit
8830cde28d
6 changed files with 56 additions and 2 deletions
|
@ -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')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue