Skip to content

Commit

Permalink
bz 1402867: Prevent scale down in scaling UI
Browse files Browse the repository at this point in the history
https://bugzilla.redhat.com/show_bug.cgi?id=1402867

In the scaling UI, added checks to allow scaling up but not down.
Scale down is handled explicitly via a separate UI action with
validation around maintenance mode on the node and lack of active
VMs.
  • Loading branch information
sseago committed Nov 30, 2017
1 parent 335ec40 commit d4dd666
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/controllers/ems_infra_controller.rb
Expand Up @@ -68,6 +68,10 @@ def scaling
return_message = _("Scaling")
@count_parameters.each do |p|
if !scale_parameters[p.name].nil? && scale_parameters[p.name] != p.value
if scale_parameters[p.name].to_s < p.value.to_s
log_and_flash_message(_("Scaling down is not supported. New value for %{name} %{new_value} is lower than current value %{current_value}.") % {:name => p.name, :new_value => scale_parameters[p.name], :current_value => p.value})
return
end
return_message += _(" %{name} from %{value} to %{parameters} ") % {:name => p.name, :value => p.value, :parameters => scale_parameters[p.name]}
scale_parameters_formatted[p.name] = scale_parameters[p.name]
end
Expand Down

0 comments on commit d4dd666

Please sign in to comment.