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
This commit is contained in:
Ryan Petrello 2018-01-22 09:41:30 -05:00
parent 09d63b4883
commit ac3f7d0fac
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -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)