From cf5224436c2b0b6cc7c099532b8b43305461e71c Mon Sep 17 00:00:00 2001 From: Girija Soni Date: Fri, 8 Dec 2023 13:54:18 +0530 Subject: [PATCH] Fixes #36953 - Fetch configured ansible tags on rerun --- app/controllers/ui_job_wizard_controller.rb | 5 ++++- app/models/job_invocation_composer.rb | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/ui_job_wizard_controller.rb b/app/controllers/ui_job_wizard_controller.rb index b9ae20f8d..0e56ad784 100644 --- a/app/controllers/ui_job_wizard_controller.rb +++ b/app/controllers/ui_job_wizard_controller.rb @@ -64,7 +64,10 @@ def job_invocation job = JobInvocation.authorized.find(params[:id]) composer = JobInvocationComposer.from_job_invocation(job, params).params job_template_inputs = JobTemplate.authorized.find(composer[:template_invocations][0][:template_id]).template_inputs_with_foreign - inputs = Hash[job_template_inputs.map { |input| ["inputs[#{input[:name]}]", {:advanced => input[:advanced], :value => (composer[:template_invocations][0][:input_values].find { |value| value[:template_input_id] == input[:id] }).try(:[], :value)}] }] + job_template_inputs_hash = Hash[job_template_inputs.map { |input| ["inputs[#{input[:name]}]", {:advanced => input[:advanced], :value => (composer[:template_invocations][0][:input_values].find { |value| value[:template_input_id] == input[:id] }).try(:[], :value)}] }] + provider_inputs = composer[:template_invocations][0][:provider_input_values] + provider_inputs_hash = Hash[provider_inputs.map { |input| ["inputs[#{input[:name]}]", {:advanced => true, :value => input[:value]}] }] + inputs = job_template_inputs_hash.merge(provider_inputs_hash) job_organization = Taxonomy.find_by(id: job.task.input[:current_organization_id]) job_location = Taxonomy.find_by(id: job.task.input[:current_location_id]) render :json => { diff --git a/app/models/job_invocation_composer.rb b/app/models/job_invocation_composer.rb index 3916697e7..185b80a22 100644 --- a/app/models/job_invocation_composer.rb +++ b/app/models/job_invocation_composer.rb @@ -271,6 +271,7 @@ def template_invocations_params job_invocation.pattern_template_invocations.map do |template_invocation| params = template_invocation.attributes.slice('template_id', 'effective_user') params['input_values'] = template_invocation.input_values.map { |v| v.attributes.slice('template_input_id', 'value') } + params['provider_input_values'] = template_invocation.provider_input_values.map { |v| v.attributes.slice('name', 'value') } params end end