diff --git a/app/controllers/ems_infra_controller.rb b/app/controllers/ems_infra_controller.rb index 7fd194390e54..9db400d3b709 100644 --- a/app/controllers/ems_infra_controller.rb +++ b/app/controllers/ems_infra_controller.rb @@ -199,9 +199,9 @@ def update_stack(stack, stack_parameters, provider_id, return_message, operation elsif !stack_parameters.empty? # A value was changed begin - stack.raw_update_stack(nil, stack_parameters) + task_id = stack.update_stack_queue(session[:userid], nil, stack_parameters) if operation == 'scaledown' - @stack.queue_post_scaledown_task(additional_args[:services]) + @stack.queue_post_scaledown_task(additional_args[:services], task_id) end redirect_to ems_infra_path(provider_id, :flash_msg => return_message) rescue => ex diff --git a/spec/controllers/ems_infra_controller_spec.rb b/spec/controllers/ems_infra_controller_spec.rb index 5cd848ba1039..dd0d3a550f3f 100644 --- a/spec/controllers/ems_infra_controller_spec.rb +++ b/spec/controllers/ems_infra_controller_spec.rb @@ -150,7 +150,7 @@ it "when patch operation fails, an error message should be displayed" do allow_any_instance_of(ManageIQ::Providers::Openstack::InfraManager::OrchestrationStack) - .to receive(:raw_update_stack) { raise _("my error") } + .to receive(:update_stack_queue) { raise _("my error") } post :scaling, :params => { :id => @ems.id, :scale => "", :orchestration_stack_id => @ems.orchestration_stacks.first.id, @orchestration_stack_parameter_compute.name => 2 } expect(controller.send(:flash_errors?)).to be_truthy @@ -219,7 +219,7 @@ it "when patch operation fails, an error message should be displayed" do allow_any_instance_of(ManageIQ::Providers::Openstack::InfraManager::OrchestrationStack) - .to receive(:raw_update_stack) { raise _("my error") } + .to receive(:update_stack_queue) { raise _("my error") } post :scaledown, :params => {:id => @ems.id, :scaledown => "", :orchestration_stack_id => @ems.orchestration_stacks.first.id, :host_ids => [@ems.hosts[1].id]} expect(controller.send(:flash_errors?)).to be_truthy