-
Notifications
You must be signed in to change notification settings - Fork 898
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
Ansible Playbook Service add on_error method. #14583
Conversation
@miq-bot add_label enhancement, services |
@@ -46,6 +46,12 @@ def postprocess(action) | |||
delete_inventory(action) unless use_default_inventory?(hosts) | |||
end | |||
|
|||
def on_error(action) |
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.
If this is only intended to be called from automate should we have a more descriptive method name?
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.
All methods are intended to be called from automate. I am ok with this name.
@tinaafitz can you add spec for this method? |
it 'handles provisioning error' do | ||
expect(executed_service).to receive(:postprocess) | ||
executed_service.on_error(action) | ||
expect(service.retirement_state).to be_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.
expect(executed_service.retirement_state).to be_nil
it 'handles retirement error' do | ||
executed_service.update_attributes(:retirement_state => 'Retiring') | ||
expect(executed_service).to receive(:postprocess) | ||
executed_service.on_error(retirement_action) |
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.
we can directly call executed_service.on_error(ResourceAction::RETIREMENT)
b93db25
to
25d97d0
Compare
25d97d0
to
d47f71d
Compare
Checked commits tinaafitz/manageiq@689c058~...d47f71d with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
@mkanoor Please review |
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.
Looks good, we need to communicate to QE how we test this error scenario.
Ansible Playbook Service add on_error method. (cherry picked from commit d7f9fe0)
Fine backport details:
|
Enhance Generic Service state machine error handling. Cleanup after provisioning and retirement failures.
https://www.pivotaltracker.com/story/show/142796573
Related PR ManageIQ/manageiq-content#85