-
Notifications
You must be signed in to change notification settings - Fork 900
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
Conversation
@miq-bot add_labels wip, refactoring, "pluggable providers" |
@jameswnl Cannot apply the following label because they are not recognized: "pluggable providers" |
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
translate the string with _()
@jameswnl I'm ok with having this called terminate for now, but IMHO it should be named closer to the actual method So, could you either add this as comments to the |
@durandom yes, I can rename terminate to vm_destroy. I thought about that too but wasn't sure - you know naming is hard 😄 |
@durandom About renaming 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 |
a0f26c9
to
24f197c
Compare
{: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) |
There was a problem hiding this comment.
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.
24f197c
to
10706ac
Compare
ok, 🏆 from my side. @miq-bot assign blomquisg |
Thanks @durandom 😄 |
10706ac
to
679cfa5
Compare
679cfa5
to
9704ecb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blomquisg merge?
@blomquisg do you need a physical ping? 😛 |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
@jameswnl can you rebase, please, after that I'll make sure its merged asap :) |
9704ecb
to
9bab451
Compare
Checked commits jameswnl/manageiq@0a95dcd~...9bab451 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
@miq-bot assign blomquisg |
@dclarizio @blomquisg This PR needs to go to Euwe to fix this BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1385587 |
VmOrTemplate supports_terminate instead of validate_terminate (cherry picked from commit 91d5c94) https://bugzilla.redhat.com/show_bug.cgi?id=1414550
Euwe backport details:
|
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.
Purpose or Intent
Replace VmOrTemplate.validate_terminate with supports_terminate