-
Notifications
You must be signed in to change notification settings - Fork 120
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
Refactoring cloud vm retirement remove_from_provider method #257
Refactoring cloud vm retirement remove_from_provider method #257
Conversation
unregister | ||
else | ||
@handle.log('info', "Unknown retirement type for VM:<#{@vm.name}> from provider:<#{@ems.name}>") | ||
exit MIQ_ABORT |
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.
@pkomanek
Can this be a raise, we tend to discourage exits from inside of method since it makes rspec to exit and difficult to debug. When these methods run as part of the Engine we fork a process and there the exit doesn't hurt but when we test it using the mocks and outside of the engine the exit has different behavior since its running directly under rspec.
$evm.log('info', "Skipping remove from provider for Instance:<#{vm.try(:name)}> on provider:<#{ems.try(:name)}>") | ||
exit MIQ_OK | ||
end | ||
if @vm.nil? || @ems.nil? |
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.
@pkomanek
Can we drop the exit MIQ_OK in favor of
if @vm && @ems
remove_vm
else
@handle.log('info', "Skipping remove from provider for Instance:<#{@vm.try(:name)}> on provider:<{@ems.try(:name)}>")
end
Checked commits pkomanek/manageiq-content@9980cc5~...1b76d5e with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Purpose or Intent
Refactoring Cloud/VM/Retirement/StateMachines/Methods.class/methods/remove_from_provider.rb method with spec. This PR is based on the issue bellow.
Links
#8
@miq-bot add_label refactoring