From be1b2b418c30fb1e7b0f899de6ade895152f8a63 Mon Sep 17 00:00:00 2001 From: AlanCoding Date: Tue, 24 Jan 2017 13:40:42 -0500 Subject: [PATCH] Remove missing resource checks from nodes --- awx/main/models/workflow.py | 7 ------- awx/main/tests/unit/models/test_workflow_unit.py | 7 ------- 2 files changed, 14 deletions(-) diff --git a/awx/main/models/workflow.py b/awx/main/models/workflow.py index a864e57390..46dd310dd7 100644 --- a/awx/main/models/workflow.py +++ b/awx/main/models/workflow.py @@ -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): diff --git a/awx/main/tests/unit/models/test_workflow_unit.py b/awx/main/tests/unit/models/test_workflow_unit.py index 6fa494e49d..ce288dced1 100644 --- a/awx/main/tests/unit/models/test_workflow_unit.py +++ b/awx/main/tests/unit/models/test_workflow_unit.py @@ -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