From 90c7514303c1b1271d841cbd3180413701e4dd75 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Thu, 12 Sep 2019 08:49:20 -0400 Subject: [PATCH] add metadata for new runner_on_start events see: https://github.com/ansible/awx/issues/4129 --- .../0089_v360_new_job_event_types.py | 23 +++++++++++++++++++ awx/main/models/events.py | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 awx/main/migrations/0089_v360_new_job_event_types.py diff --git a/awx/main/migrations/0089_v360_new_job_event_types.py b/awx/main/migrations/0089_v360_new_job_event_types.py new file mode 100644 index 0000000000..5bab589371 --- /dev/null +++ b/awx/main/migrations/0089_v360_new_job_event_types.py @@ -0,0 +1,23 @@ +# Generated by Django 2.2.4 on 2019-09-12 13:05 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0088_v360_dashboard_optimizations'), + ] + + operations = [ + migrations.AlterField( + model_name='jobevent', + name='event', + field=models.CharField(choices=[('runner_on_failed', 'Host Failed'), ('runner_on_start', 'Host Started'), ('runner_on_ok', 'Host OK'), ('runner_on_error', 'Host Failure'), ('runner_on_skipped', 'Host Skipped'), ('runner_on_unreachable', 'Host Unreachable'), ('runner_on_no_hosts', 'No Hosts Remaining'), ('runner_on_async_poll', 'Host Polling'), ('runner_on_async_ok', 'Host Async OK'), ('runner_on_async_failed', 'Host Async Failure'), ('runner_item_on_ok', 'Item OK'), ('runner_item_on_failed', 'Item Failed'), ('runner_item_on_skipped', 'Item Skipped'), ('runner_retry', 'Host Retry'), ('runner_on_file_diff', 'File Difference'), ('playbook_on_start', 'Playbook Started'), ('playbook_on_notify', 'Running Handlers'), ('playbook_on_include', 'Including File'), ('playbook_on_no_hosts_matched', 'No Hosts Matched'), ('playbook_on_no_hosts_remaining', 'No Hosts Remaining'), ('playbook_on_task_start', 'Task Started'), ('playbook_on_vars_prompt', 'Variables Prompted'), ('playbook_on_setup', 'Gathering Facts'), ('playbook_on_import_for_host', 'internal: on Import for Host'), ('playbook_on_not_import_for_host', 'internal: on Not Import for Host'), ('playbook_on_play_start', 'Play Started'), ('playbook_on_stats', 'Playbook Complete'), ('debug', 'Debug'), ('verbose', 'Verbose'), ('deprecated', 'Deprecated'), ('warning', 'Warning'), ('system_warning', 'System Warning'), ('error', 'Error')], max_length=100), + ), + migrations.AlterField( + model_name='projectupdateevent', + name='event', + field=models.CharField(choices=[('runner_on_failed', 'Host Failed'), ('runner_on_start', 'Host Started'), ('runner_on_ok', 'Host OK'), ('runner_on_error', 'Host Failure'), ('runner_on_skipped', 'Host Skipped'), ('runner_on_unreachable', 'Host Unreachable'), ('runner_on_no_hosts', 'No Hosts Remaining'), ('runner_on_async_poll', 'Host Polling'), ('runner_on_async_ok', 'Host Async OK'), ('runner_on_async_failed', 'Host Async Failure'), ('runner_item_on_ok', 'Item OK'), ('runner_item_on_failed', 'Item Failed'), ('runner_item_on_skipped', 'Item Skipped'), ('runner_retry', 'Host Retry'), ('runner_on_file_diff', 'File Difference'), ('playbook_on_start', 'Playbook Started'), ('playbook_on_notify', 'Running Handlers'), ('playbook_on_include', 'Including File'), ('playbook_on_no_hosts_matched', 'No Hosts Matched'), ('playbook_on_no_hosts_remaining', 'No Hosts Remaining'), ('playbook_on_task_start', 'Task Started'), ('playbook_on_vars_prompt', 'Variables Prompted'), ('playbook_on_setup', 'Gathering Facts'), ('playbook_on_import_for_host', 'internal: on Import for Host'), ('playbook_on_not_import_for_host', 'internal: on Not Import for Host'), ('playbook_on_play_start', 'Play Started'), ('playbook_on_stats', 'Playbook Complete'), ('debug', 'Debug'), ('verbose', 'Verbose'), ('deprecated', 'Deprecated'), ('warning', 'Warning'), ('system_warning', 'System Warning'), ('error', 'Error')], max_length=100), + ), + ] diff --git a/awx/main/models/events.py b/awx/main/models/events.py index d57a805c61..d8680708e0 100644 --- a/awx/main/models/events.py +++ b/awx/main/models/events.py @@ -83,6 +83,7 @@ class BasePlaybookEvent(CreatedModifiedModel): # - runner_on* # - playbook_on_task_start (once for each task within a play) # - runner_on_failed + # - runner_on_start # - runner_on_ok # - runner_on_error (not used for v2) # - runner_on_skipped @@ -102,6 +103,7 @@ class BasePlaybookEvent(CreatedModifiedModel): EVENT_TYPES = [ # (level, event, verbose name, failed) (3, 'runner_on_failed', _('Host Failed'), True), + (3, 'runner_on_start', _('Host Started'), False), (3, 'runner_on_ok', _('Host OK'), False), (3, 'runner_on_error', _('Host Failure'), True), (3, 'runner_on_skipped', _('Host Skipped'), False),