mirror of
https://github.com/ansible/ansible.git
synced 2026-08-03 08:03:05 +02:00
_run_loop: Add the task name to the warning (#76012)
Prepend the task name to the warning "The loop variable 'item' is already in use", so that you can get some context even if stdout and stderr go to separate places.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
bugfixes:
|
||||
- _run_loop - Add the task name to the warning
|
||||
(https://github.com/ansible/ansible/issues/76011)
|
||||
@@ -293,9 +293,9 @@ class TaskExecutor:
|
||||
label = '{{' + loop_var + '}}'
|
||||
|
||||
if loop_var in task_vars:
|
||||
display.warning(u"The loop variable '%s' is already in use. "
|
||||
display.warning(u"%s: The loop variable '%s' is already in use. "
|
||||
u"You should set the `loop_var` value in the `loop_control` option for the task"
|
||||
u" to something else to avoid variable collisions and unexpected behavior." % loop_var)
|
||||
u" to something else to avoid variable collisions and unexpected behavior." % (self._task, loop_var))
|
||||
|
||||
ran_once = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user