From 46734f5c10ed1903e3de06283a5ca2ab65e4656f Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 10 Jul 2020 15:43:23 -0400 Subject: [PATCH] Add artifacts field of jobs to the allowed list for notifications --- awx/main/models/notifications.py | 3 ++- awx/main/tests/functional/models/test_notifications.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/main/models/notifications.py b/awx/main/models/notifications.py index de0432e312..c374f60420 100644 --- a/awx/main/models/notifications.py +++ b/awx/main/models/notifications.py @@ -267,7 +267,7 @@ class JobNotificationMixin(object): 'timeout', 'use_fact_cache', 'launch_type', 'status', 'failed', 'started', 'finished', 'elapsed', 'job_explanation', 'execution_node', 'controller_node', 'allow_simultaneous', 'scm_revision', 'diff_mode', 'job_slice_number', 'job_slice_count', 'custom_virtualenv', - 'approval_status', 'approval_node_name', 'workflow_url', 'scm_branch', + 'approval_status', 'approval_node_name', 'workflow_url', 'scm_branch', 'artifacts', {'host_status_counts': ['skipped', 'ok', 'changed', 'failed', 'failures', 'dark' 'processed', 'rescued', 'ignored']}, {'summary_fields': [{'inventory': ['id', 'name', 'description', 'has_active_failures', @@ -288,6 +288,7 @@ class JobNotificationMixin(object): Context has the same structure as the context that will actually be used to render a notification message.""" context = {'job': {'allow_simultaneous': False, + 'artifacts': {}, 'controller_node': 'foo_controller', 'created': datetime.datetime(2018, 11, 13, 6, 4, 0, 0, tzinfo=datetime.timezone.utc), 'custom_virtualenv': 'my_venv', diff --git a/awx/main/tests/functional/models/test_notifications.py b/awx/main/tests/functional/models/test_notifications.py index 4208843969..8d514312ae 100644 --- a/awx/main/tests/functional/models/test_notifications.py +++ b/awx/main/tests/functional/models/test_notifications.py @@ -12,6 +12,7 @@ from awx.api.serializers import UnifiedJobSerializer class TestJobNotificationMixin(object): CONTEXT_STRUCTURE = {'job': {'allow_simultaneous': bool, + 'artifacts': {}, 'custom_virtualenv': str, 'controller_node': str, 'created': datetime.datetime,