Skip to content

Commit

Permalink
use task queue for update stack operation
Browse files Browse the repository at this point in the history
Update stack should use the task queue for direct operation on the
provider (used by scaling/scaledown UI in ems infra)

This commit includes the necessary UI changes.
  • Loading branch information
sseago committed Feb 14, 2017
1 parent 5dbab14 commit a9afa48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/controllers/ems_infra_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/ems_infra_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a9afa48

Please sign in to comment.