Bug 1562782

Summary: A state machine's on_exit method runs before the main method if the main method is an embedded Ansible playbook
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: AutomateAssignee: Tina Fitzgerald <tfitzger>
Status: CLOSED ERRATA QA Contact: Dmitry Misharov <dmisharo>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: cpelland, dmisharo, mkanoor, obarenbo, pmcgowan, tfitzger, wfitzger
Target Milestone: GAKeywords: Reopened, ZStream
Target Release: 5.9.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.9.2.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1557310 Environment:
Last Closed: 2018-05-07 20:48:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Bug Depends On: 1557310, 1568384    
Bug Blocks:    

Comment 2 CFME Bot 2018-04-02 13:37:12 UTC
New commit detected on ManageIQ/manageiq-automation_engine/gaprindashvili:

https://github.com/ManageIQ/manageiq-automation_engine/commit/0c3ee3c99138767a59eacf31c6e66c3433f78636
commit 0c3ee3c99138767a59eacf31c6e66c3433f78636
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Thu Mar 29 14:47:57 2018 -0400
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Thu Mar 29 14:47:57 2018 -0400

    Merge pull request #168 from tinaafitz/fix_retry_for_on_exit

    Don't call on_exit method while Ansible Playbook method is running.
    (cherry picked from commit 089de0f03ffcc3ed1e4c1d592317accdb2d716e0)

    https://bugzilla.redhat.com/show_bug.cgi?id=1562782

 lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_playbook_method.rb | 2 +-
 lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_state_machine.rb | 16 +-
 spec/engine/miq_ae_state_machine_steps_spec.rb | 14 +
 spec/miq_ae_playbook_method_spec.rb | 6 +-
 4 files changed, 28 insertions(+), 10 deletions(-)

Comment 3 Dmitry Misharov 2018-04-20 07:29:54 UTC
I cannot verify this BZ until this issue will be fixed https://bugzilla.redhat.com/show_bug.cgi?id=1568384. But the target release for it is 5.9.3. Chris, can we change target release for one these BZs?

Comment 5 Dmitry Misharov 2018-05-02 08:49:32 UTC
Fixed and verified in 5.9.2.4.20180501195858_35dc609. on_exit is not called when the playbook was launched in a state machine.

Comment 8 errata-xmlrpc 2018-05-07 20:48:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:1328