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

Use task cancelation_status to trigger cancelation #457

Merged
merged 3 commits into from
Nov 6, 2018

Conversation

ghost
Copy link

@ghost ghost commented Oct 29, 2018

To prevent cancel_request option override, ManageIQ/manageiq#17825 introduced an attribute to the task object. This PR changes the Automate code to rely on this attribute.

Associated RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1614864

@ghost
Copy link
Author

ghost commented Oct 29, 2018

@miq-bot add-label transformation, enhancement, hammer/yes

@ghost
Copy link
Author

ghost commented Oct 29, 2018

@miq-bot add-label blocker

@ghost
Copy link
Author

ghost commented Oct 31, 2018

@mkanoor @gmcculloug could you please review ?

@gmcculloug gmcculloug self-assigned this Nov 5, 2018
@@ -139,7 +139,7 @@ def main
if @handle.root['ae_state_step'] == 'on_error'
task.message = 'Failed'
create_cleanup_request(task)
elsif task.get_option('cancel_requested') && task.get_option(:cleanup_request_id).blank?
elsif task.cancelation_status == 'cancel_requested' && task.get_option(:cleanup_request_id).blank?
Copy link
Member

Choose a reason for hiding this comment

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

Don't hard-code the status strings. Use the defined methods:

    expose :cancel_requested?
    expose :canceling?
    expose :canceled?

https://github.com/ManageIQ/manageiq-automation_engine/blob/master/lib/miq_automation_engine/service_models/miq_ae_service_miq_request_task.rb#L13-L15

Copy link
Author

Choose a reason for hiding this comment

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

Sure. Done.

Copy link
Member

@gmcculloug gmcculloug left a comment

Choose a reason for hiding this comment

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

One change, otherwise I this looks good.

@miq-bot
Copy link
Member

miq-bot commented Nov 6, 2018

Checked commits fabiendupont/manageiq-content@ace9b52~...1af9186 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
3 files checked, 0 offenses detected
Everything looks fine. 🍪

@gmcculloug gmcculloug merged commit 2160a0e into ManageIQ:master Nov 6, 2018
@gmcculloug gmcculloug added this to the Sprint 99 Ending Nov 19, 2018 milestone Nov 6, 2018
simaishi pushed a commit that referenced this pull request Nov 6, 2018
@simaishi
Copy link
Contributor

simaishi commented Nov 6, 2018

Hammer backport details:

$ git log -1
commit dc010c59c769cd2e9bd0fa082b1be570d892333d
Author: Greg McCullough <gmccullo@redhat.com>
Date:   Tue Nov 6 09:39:33 2018 -0500

    Merge pull request #457 from fdupont-redhat/v2v_use_cancelation_status
    
    Use task cancelation_status to trigger cancelation
    
    (cherry picked from commit 2160a0e410fa196b6a0061a62aa36e2705586c8e)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1614864

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.

4 participants