mirror of
https://github.com/ansible/awx.git
synced 2026-06-29 10:28:01 -02:30
Do not set the default if the field was not passed in to kwargs_extra_vars
This commit is contained in:
@@ -130,12 +130,14 @@ class SurveyJobTemplateMixin(models.Model):
|
||||
for survey_element in self.survey_spec.get("spec", []):
|
||||
default = survey_element.get('default')
|
||||
variable_key = survey_element.get('variable')
|
||||
|
||||
if survey_element.get('type') == 'password':
|
||||
if variable_key in kwargs_extra_vars and default:
|
||||
kw_value = kwargs_extra_vars[variable_key]
|
||||
if kw_value.startswith('$encrypted$') and kw_value != default:
|
||||
kwargs_extra_vars[variable_key] = default
|
||||
if default is not None:
|
||||
|
||||
if default is not None and variable_key in extra_vars:
|
||||
extra_vars[variable_key] = default
|
||||
|
||||
# Overwrite job template extra vars with explicit job extra vars
|
||||
|
||||
Reference in New Issue
Block a user