update delete

This commit is contained in:
sean-m-sullivan 2020-10-10 13:02:58 -05:00
parent 7ffa70422a
commit c3045f6a29

View File

@ -237,7 +237,7 @@ def main():
if state == 'absent':
# If the state was absent we can let the module delete it if needed, the module will handle exiting from this
module.delete_if_needed(existing_item)
module.delete_if_needed(existing_item, on_continue=True,)
unified_job_template = module.params.get('unified_job_template')
if unified_job_template:
@ -311,6 +311,9 @@ def main():
# Due to not able to lookup workflow_approval_templates, find the existing item in another place
if workflow_job_template_node['related'].get('unified_job_template') is not None:
existing_item = module.get_endpoint(workflow_job_template_node['related']['unified_job_template'])['json']
if state == 'absent':
# If the state was absent we can let the module delete it if needed, the module will handle exiting from this
module.delete_if_needed(existing_item)
module.create_or_update_if_needed(
existing_item, new_fields,
endpoint='workflow_job_template_nodes/' + str(workflow_job_template_node_id) + '/create_approval_template/', item_type='workflow_job_template_approval_node', on_continue=approval_node,