Skip to content

Commit

Permalink
Use parent_ workflow_id for MiqProvision options
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Aug 26, 2024
1 parent c69f814 commit 3ca43d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/models/miq_provision_request_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def service_options(parent_svc, service_task, template_service_resource)
:service_guid => parent_svc.guid,
:service_resource_id => template_service_resource.id,
:service_template_request => false,
:configuration_script_payload_id => parent_service_task&.resource_action&.configuration_script_payload&.id
:configuration_script_payload_id => parent_service_task&.options&.dig(:parent_configuration_script_payload_id)
}
end

Expand Down
14 changes: 8 additions & 6 deletions app/models/service_template_provision_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,17 @@ def requested_task_idx
def customize_request_task_attributes(req_task_attrs, idx)
req_task_attrs['options'][:pass] = idx

# If the service_template that we are provisioning is a "generic" provision
# type then we want to execute the request task with embedded_workflows if
# the resource_action has a configuration_script_id
return if source.prov_type != "generic"

configuration_script_id = resource_action&.configuration_script_id
return if configuration_script_id.nil?

req_task_attrs['options'][:configuration_script_payload_id] = configuration_script_id
# If the service_template that we are provisioning is a "generic" provision
# type then we want to execute the request task with embedded_workflows if
# the resource_action has a configuration_script_id
if source.prov_type == "generic"
req_task_attrs['options'][:configuration_script_payload_id] = configuration_script_id
else
req_task_attrs['options'][:parent_configuration_script_payload_id] = configuration_script_id
end
end

def resource_action
Expand Down

0 comments on commit 3ca43d5

Please sign in to comment.