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

Conversation

sseago
Copy link
Contributor

@sseago sseago commented Nov 30, 2017

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.

@sseago
Copy link
Contributor Author

sseago commented Nov 30, 2017

@miq-bot add_label gaprindashvili/yes
@miq-bot add_label fine/yes

@@ -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})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log_and_flash_message() was removed recently from our code. Now, you should just use add_flash(...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mzazrivec OK I updated this to reflect the change.

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.
@miq-bot
Copy link
Member

miq-bot commented Dec 5, 2017

Checked commit sseago@0d5216a with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 1 offense detected

app/controllers/ems_infra_controller.rb

@mzazrivec mzazrivec self-assigned this Dec 6, 2017
@mzazrivec mzazrivec added this to the Sprint 75 Ending Dec 11, 2017 milestone Dec 6, 2017
@mzazrivec mzazrivec merged commit 7b16236 into ManageIQ:master Dec 6, 2017
simaishi pushed a commit that referenced this pull request Dec 8, 2017
bz 1402867: Prevent scale down in scaling UI
(cherry picked from commit 7b16236)

https://bugzilla.redhat.com/show_bug.cgi?id=1523855
@simaishi
Copy link
Contributor

simaishi commented Dec 8, 2017

Fine backport details:

$ git log -1
commit 95d4c811326f6f5407eaa535ee276ac0725cf19d
Author: Milan Zázrivec <mzazrivec@redhat.com>
Date:   Wed Dec 6 14:33:15 2017 +0100

    Merge pull request #2889 from sseago/validate_scale_up
    
    bz 1402867: Prevent scale down in scaling UI
    (cherry picked from commit 7b16236f4696d990263ff39edc6ed6c9a5bd9e4f)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1523855

simaishi pushed a commit that referenced this pull request Dec 11, 2017
bz 1402867: Prevent scale down in scaling UI
(cherry picked from commit 7b16236)

https://bugzilla.redhat.com/show_bug.cgi?id=1524653
@simaishi
Copy link
Contributor

Gaprindashvili backport details:

$ git log -1
commit 6ad81f74d9b7bf7e48c5b2d8a219624344d8ace3
Author: Milan Zázrivec <mzazrivec@redhat.com>
Date:   Wed Dec 6 14:33:15 2017 +0100

    Merge pull request #2889 from sseago/validate_scale_up
    
    bz 1402867: Prevent scale down in scaling UI
    (cherry picked from commit 7b16236f4696d990263ff39edc6ed6c9a5bd9e4f)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1524653

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants