mirror of
https://github.com/ansible/awx.git
synced 2026-03-11 22:49:32 -02:30
Fix another bug applying extra_vars to incompatible job types
This commit is contained in:
@@ -965,10 +965,14 @@ class LaunchTimeConfigBase(BaseModel):
|
|||||||
'execution_environment', # already a unified job and unified JT field
|
'execution_environment', # already a unified job and unified JT field
|
||||||
)
|
)
|
||||||
|
|
||||||
def prompts_dict(self, display=False):
|
def prompts_dict(self, display=False, for_cls=None):
|
||||||
data = {}
|
data = {}
|
||||||
|
if for_cls:
|
||||||
|
cls = for_cls
|
||||||
|
else:
|
||||||
|
cls = JobTemplate
|
||||||
# Some types may have different prompts, but always subset of JT prompts
|
# Some types may have different prompts, but always subset of JT prompts
|
||||||
for prompt_name in JobTemplate.get_ask_mapping().keys():
|
for prompt_name in cls.get_ask_mapping().keys():
|
||||||
try:
|
try:
|
||||||
field = self._meta.get_field(prompt_name)
|
field = self._meta.get_field(prompt_name)
|
||||||
except FieldDoesNotExist:
|
except FieldDoesNotExist:
|
||||||
|
|||||||
@@ -304,8 +304,8 @@ class WorkflowJobNode(WorkflowNodeBase):
|
|||||||
wj_special_passwords = {}
|
wj_special_passwords = {}
|
||||||
ujt_obj = self.unified_job_template
|
ujt_obj = self.unified_job_template
|
||||||
if ujt_obj is not None:
|
if ujt_obj is not None:
|
||||||
node_prompts_data = self.prompts_dict()
|
node_prompts_data = self.prompts_dict(for_cls=ujt_obj.__class__)
|
||||||
wj_prompts_data = self.workflow_job.prompts_dict()
|
wj_prompts_data = self.workflow_job.prompts_dict(for_cls=ujt_obj.__class__)
|
||||||
# Explanation - special historical case
|
# Explanation - special historical case
|
||||||
# WFJT extra_vars ignored JobTemplate.ask_variables_on_launch, bypassing _accept_or_ignore_job_kwargs
|
# WFJT extra_vars ignored JobTemplate.ask_variables_on_launch, bypassing _accept_or_ignore_job_kwargs
|
||||||
# inventory and others are only accepted if JT prompts for it with related ask_ field
|
# inventory and others are only accepted if JT prompts for it with related ask_ field
|
||||||
|
|||||||
Reference in New Issue
Block a user