Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bz 1402867: Prevent scale down in scaling UI #2889

Merged
merged 1 commit into from Dec 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/controllers/ems_infra_controller.rb
Expand Up @@ -70,6 +70,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
add_flash(_("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}, :error)
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