From ac3f7d0fac886c8c7cac82ccb3c10661b1ad8366 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Mon, 22 Jan 2018 09:41:30 -0500 Subject: [PATCH] fix a bug that breaks workflows w/ a survey password + inventory sync prior versions of awx did not raise an exception for this scenario - they simply ignored kwargs that they couldn't accept. this change is a sort of middle ground - it ignores them, but gives a clue in the logs as to why see: https://github.com/ansible/awx/issues/955 related: https://github.com/ansible/awx/pull/803 --- awx/main/models/unified_jobs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index dd9deff77f..97a03d6845 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -355,7 +355,8 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, Notificatio fields = self._get_unified_job_field_names() unallowed_fields = set(kwargs.keys()) - set(fields) if unallowed_fields: - raise Exception('Fields {} are not allowed as overrides.'.format(unallowed_fields)) + logger.warn('Fields {} are not allowed as overrides.'.format(unallowed_fields)) + map(kwargs.pop, unallowed_fields) unified_job = copy_model_by_class(self, unified_job_class, fields, kwargs)