From fbd27e25a6ba9086bee6fa3bb5eefa9a6b778480 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Mon, 28 Nov 2016 16:55:11 -0500 Subject: [PATCH 1/2] Fix scan job relaunch bug --- awx/main/models/unified_jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 65ab501913..7bc89d657c 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -675,7 +675,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique fields = unified_jt_class._get_unified_job_field_names() + [parent_field_name] unified_job = copy_model_by_class(self, unified_job_class, fields, {}) - unified_job.job_type = 'relaunch' + unified_job.launch_type = 'relaunch' unified_job.save() # Labels coppied here From dd02ab329a119fdfec828aa76c059730949c2287 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Tue, 29 Nov 2016 08:07:57 -0500 Subject: [PATCH 2/2] add test assertions that check the relaunch job_type bug --- awx/main/tests/functional/test_jobs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awx/main/tests/functional/test_jobs.py b/awx/main/tests/functional/test_jobs.py index 63cc62b03b..5169d98fb1 100644 --- a/awx/main/tests/functional/test_jobs.py +++ b/awx/main/tests/functional/test_jobs.py @@ -10,6 +10,8 @@ def test_orphan_unified_job_creation(instance, inventory): assert job2.job_template is None assert job2.inventory == inventory assert job2.name == 'hi world' + assert job.job_type == job2.job_type + assert job2.launch_type == 'relaunch' @pytest.mark.django_db