From 940d914904489365ff1e6c93194979f1ad889170 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Sat, 8 Apr 2023 07:28:11 -0400 Subject: [PATCH] json[l] callback: add play/task path info Add the play and task path info (i.e., filename and line number) to the JSON that is emitted from the json and jsonl callback plugins, allowing more accurate post-mortem analysis. Signed-off-by: Jeff Squyres --- changelogs/fragments/440-json-add-path-field.yaml | 2 ++ plugins/callback/json.py | 2 ++ plugins/callback/jsonl.py | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 changelogs/fragments/440-json-add-path-field.yaml diff --git a/changelogs/fragments/440-json-add-path-field.yaml b/changelogs/fragments/440-json-add-path-field.yaml new file mode 100644 index 0000000..4c15dcc --- /dev/null +++ b/changelogs/fragments/440-json-add-path-field.yaml @@ -0,0 +1,2 @@ +minor_changes: + - json and jsonl - Add the ``path`` attribute into the play and task output diff --git a/plugins/callback/json.py b/plugins/callback/json.py index f0c56b4..512f25b 100644 --- a/plugins/callback/json.py +++ b/plugins/callback/json.py @@ -67,6 +67,7 @@ class CallbackModule(CallbackBase): 'play': { 'name': play.get_name(), 'id': to_text(play._uuid), + 'path': to_text(play.get_path()), 'duration': { 'start': current_time() } @@ -79,6 +80,7 @@ class CallbackModule(CallbackBase): 'task': { 'name': task.get_name(), 'id': to_text(task._uuid), + 'path': to_text(task.get_path()), 'duration': { 'start': current_time() } diff --git a/plugins/callback/jsonl.py b/plugins/callback/jsonl.py index 2403dba..dc77b03 100644 --- a/plugins/callback/jsonl.py +++ b/plugins/callback/jsonl.py @@ -69,6 +69,7 @@ class CallbackModule(CallbackBase): 'play': { 'name': play.get_name(), 'id': to_text(play._uuid), + 'path': to_text(play.get_path()), 'duration': { 'start': current_time() } @@ -81,6 +82,7 @@ class CallbackModule(CallbackBase): 'task': { 'name': task.get_name(), 'id': to_text(task._uuid), + 'path': to_text(task.get_path()), 'duration': { 'start': current_time() }