From 5760654671c5a7cf26d165713cf83d8ff9ae3f64 Mon Sep 17 00:00:00 2001 From: Chris Church Date: Mon, 7 Nov 2016 21:42:39 -0500 Subject: [PATCH] Fix warning from v2_playbook_on_task_start with ad hoc commands. --- awx/lib/tower_display_callback/module.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/lib/tower_display_callback/module.py b/awx/lib/tower_display_callback/module.py index 02b30ef2bc..daa2bb8d4a 100644 --- a/awx/lib/tower_display_callback/module.py +++ b/awx/lib/tower_display_callback/module.py @@ -160,10 +160,13 @@ class BaseCallbackModule(CallbackBase): # FIXME: Task is "global" unless using free strategy! task_ctx = dict( task=(task.name or task.action), - task_path=task.get_path(), task_uuid=str(task._uuid), task_action=task.action, ) + try: + task_ctx['task_path'] = task.get_path() + except AttributeError: + pass if not task.no_log: task_args = ', '.join(('%s=%s' % a for a in task.args.items())) task_ctx['task_args'] = task_args