mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 10:30:03 -03:30
Remove missing resource checks from nodes
This commit is contained in:
parent
baef3797f3
commit
be1b2b418c
@ -125,23 +125,16 @@ class WorkflowNodeBase(CreatedModifiedModel):
|
||||
return {}
|
||||
|
||||
accepted_fields, ignored_fields = ujt_obj._accept_or_ignore_job_kwargs(**prompts_dict)
|
||||
ask_for_vars_dict = ujt_obj._ask_for_vars_dict()
|
||||
|
||||
ignored_dict = {}
|
||||
missing_dict = {}
|
||||
for fd in ignored_fields:
|
||||
ignored_dict[fd] = 'Workflow node provided field, but job template is not set to ask on launch'
|
||||
scan_errors = ujt_obj._extra_job_type_errors(accepted_fields)
|
||||
ignored_dict.update(scan_errors)
|
||||
for fd in ['inventory', 'credential']:
|
||||
if getattr(ujt_obj, "{}_id".format(fd)) is None and not (ask_for_vars_dict.get(fd, False) and fd in prompts_dict):
|
||||
missing_dict[fd] = 'Job Template does not have this field and workflow node does not provide it'
|
||||
|
||||
data = {}
|
||||
if ignored_dict:
|
||||
data['ignored'] = ignored_dict
|
||||
if missing_dict:
|
||||
data['missing'] = missing_dict
|
||||
return data
|
||||
|
||||
def get_parent_nodes(self):
|
||||
|
||||
@ -239,10 +239,3 @@ class TestWorkflowWarnings:
|
||||
assert 'job_type' in job_node_with_prompts.get_prompts_warnings()['ignored']
|
||||
assert 'inventory' in job_node_with_prompts.get_prompts_warnings()['ignored']
|
||||
assert len(job_node_with_prompts.get_prompts_warnings()['ignored']) == 2
|
||||
|
||||
def test_warn_missing_fields(self, job_node_no_prompts):
|
||||
job_node_no_prompts.inventory = None
|
||||
assert 'missing' in job_node_no_prompts.get_prompts_warnings()
|
||||
assert 'inventory' in job_node_no_prompts.get_prompts_warnings()['missing']
|
||||
assert 'credential' in job_node_no_prompts.get_prompts_warnings()['missing']
|
||||
assert len(job_node_no_prompts.get_prompts_warnings()['missing']) == 2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user