Fix warning from v2_playbook_on_task_start with ad hoc commands.

This commit is contained in:
Chris Church
2016-11-07 21:42:39 -05:00
parent 62caaa728c
commit 5760654671

View File

@@ -160,10 +160,13 @@ class BaseCallbackModule(CallbackBase):
# FIXME: Task is "global" unless using free strategy! # FIXME: Task is "global" unless using free strategy!
task_ctx = dict( task_ctx = dict(
task=(task.name or task.action), task=(task.name or task.action),
task_path=task.get_path(),
task_uuid=str(task._uuid), task_uuid=str(task._uuid),
task_action=task.action, task_action=task.action,
) )
try:
task_ctx['task_path'] = task.get_path()
except AttributeError:
pass
if not task.no_log: if not task.no_log:
task_args = ', '.join(('%s=%s' % a for a in task.args.items())) task_args = ', '.join(('%s=%s' % a for a in task.args.items()))
task_ctx['task_args'] = task_args task_ctx['task_args'] = task_args