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

VmOrTemplate supports_terminate instead of validate_terminate #11018

Merged
merged 2 commits into from
Oct 5, 2016

Conversation

jameswnl
Copy link
Contributor

@jameswnl jameswnl commented Sep 6, 2016

Purpose or Intent

Replace VmOrTemplate.validate_terminate with supports_terminate

@jameswnl
Copy link
Contributor Author

jameswnl commented Sep 6, 2016

@miq-bot add_labels wip, refactoring, "pluggable providers"

@miq-bot
Copy link
Member

miq-bot commented Sep 6, 2016

@jameswnl Cannot apply the following label because they are not recognized: "pluggable providers"

@jameswnl jameswnl changed the title [WIP] VmOrTemplate supports_terminate instead of validate_terminate VmOrTemplate supports_terminate instead of validate_terminate Sep 6, 2016
return {:available => false, :message => 'The VM is terminated'} if self.terminated?
{:available => true, :message => nil}
supports :terminate do
unsupported_reason_add(:terminate, 'The VM is terminated') if terminated?
Copy link
Member

Choose a reason for hiding this comment

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

translate the string with _()

@durandom
Copy link
Member

durandom commented Sep 7, 2016

@jameswnl I'm ok with having this called terminate for now, but IMHO it should be named closer to the actual method vm_destroy, but this would involve more refactoring.

So, could you either add this as comments to the supports :terminate method or even better refactor the calls to supports :vm_destroy? There is only a couple of occurences in the code, as I can see

@jameswnl
Copy link
Contributor Author

jameswnl commented Sep 7, 2016

@durandom yes, I can rename terminate to vm_destroy. I thought about that too but wasn't sure - you know naming is hard 😄
Since you also support, I'll do that.

@jameswnl
Copy link
Contributor Author

jameswnl commented Sep 7, 2016

@durandom About renaming terminate: I saw a previous test for validate_terminate was removed by your PR. Can you advise on how to confirm the name change is not breaking UI?

Update: I've tried to rename it and it breaks a bunch of tests. I've since reverted the renaming. Let's keep this PR focusing on getting the supports_terminate done first.

@jameswnl jameswnl force-pushed the validate_terminate branch 2 times, most recently from a0f26c9 to 24f197c Compare September 7, 2016 17:50
{:available => true, :message => nil}
supports :terminate do
msg = unsupported_reason(:control) unless supports_control?
msg ||= _("Provider doesn't support vm_destroy") unless ext_management_system.respond_to?(:vm_destroy)
Copy link
Member

Choose a reason for hiding this comment

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

when checking for two reason we just added all reasons

unsupported_reason_add(:vm_destroy, unsupported_reason(:control)) unless supports_control?
unsupported_reason_add(:vm_destroy, _("Provider doesn't support vm_destroy") unless ext_management_system.respond_to?(:vm_destroy))

This way we could later even stack the reasons when asking for this.

@durandom
Copy link
Member

durandom commented Sep 8, 2016

ok, 🏆 from my side.

@miq-bot assign blomquisg
@blomquisg merge?

@miq-bot miq-bot assigned blomquisg and unassigned durandom Sep 8, 2016
@jameswnl
Copy link
Contributor Author

jameswnl commented Sep 8, 2016

Thanks @durandom 😄

Copy link
Member

@durandom durandom left a comment

Choose a reason for hiding this comment

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

:shipit:

@blomquisg merge?

@jameswnl
Copy link
Contributor Author

@blomquisg do you need a physical ping? 😛

@miq-bot
Copy link
Member

miq-bot commented Sep 30, 2016

<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush.

@durandom
Copy link
Member

durandom commented Oct 4, 2016

@jameswnl can you rebase, please, after that I'll make sure its merged asap :)

@jameswnl jameswnl force-pushed the validate_terminate branch from 9704ecb to 9bab451 Compare October 4, 2016 19:53
@miq-bot
Copy link
Member

miq-bot commented Oct 4, 2016

Checked commits jameswnl/manageiq@0a95dcd~...9bab451 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
3 files checked, 0 offenses detected
Everything looks good. ⭐

@durandom
Copy link
Member

durandom commented Oct 5, 2016

@miq-bot assign blomquisg
@miq-bot add_label euwe/no
@blomquisg please merge, thanks

@miq-bot miq-bot assigned blomquisg and unassigned durandom Oct 5, 2016
@miq-bot miq-bot added the euwe/no label Oct 5, 2016
@blomquisg blomquisg merged commit 91d5c94 into ManageIQ:master Oct 5, 2016
@blomquisg blomquisg added this to the Sprint 48 Ending Oct 24, 2016 milestone Oct 5, 2016
@jameswnl jameswnl deleted the validate_terminate branch December 1, 2016 22:36
@romanblanco
Copy link
Member

romanblanco commented Jan 17, 2017

@dclarizio @blomquisg This PR needs to go to Euwe to fix this BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1385587

simaishi pushed a commit that referenced this pull request Jan 18, 2017
VmOrTemplate supports_terminate instead of validate_terminate
(cherry picked from commit 91d5c94)

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

Euwe backport details:

$ git log -1
commit 084ecea58bfb4fa5481839c9a7196a3c018e4bdf
Author: Greg Blomquist <[email protected]>
Date:   Wed Oct 5 14:37:39 2016 -0400

    Merge pull request #11018 from jameswnl/validate_terminate
    
    VmOrTemplate supports_terminate instead of validate_terminate
    (cherry picked from commit 91d5c94c112abf7bcc3b73f743865f7ac682b3ca)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1414550

jrafanie added a commit to jrafanie/manageiq that referenced this pull request Feb 20, 2017
https://bugzilla.redhat.com/show_bug.cgi?id=1423470

b691300 for PR ManageIQ#11418 was backported before
084ecea for PR ManageIQ#11018, causing some git context to bring
over the :terminate key twice.
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.

8 participants