Bug 1552800

Summary: Retirement requester is not passed down correctly to automate
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: AutomateAssignee: Lucy Fu <lufu>
Status: CLOSED ERRATA QA Contact: Brandon Squizzato <bsquizza>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.0CC: bsquizza, gekis, gmccullo, izapolsk, mkanoor, obarenbo, rmanes, simaishi, smallamp, tfitzger
Target Milestone: GAKeywords: ZStream
Target Release: 5.9.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.9.2.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1547527 Environment:
Last Closed: 2018-05-07 20:44:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1547527    
Bug Blocks:    

Comment 2 CFME Bot 2018-03-07 19:41:23 UTC
New commit detected on ManageIQ/manageiq/gaprindashvili:

https://github.com/ManageIQ/manageiq/commit/9042c3eab43bdd1724431cb22c71b4c651d54846
commit 9042c3eab43bdd1724431cb22c71b4c651d54846
Author:     Greg McCullough <gmccullo>
AuthorDate: Fri Feb 23 16:25:49 2018 -0500
Commit:     Greg McCullough <gmccullo>
CommitDate: Fri Feb 23 16:25:49 2018 -0500

    Merge pull request #17033 from lfu/retirement_requester_1547527

    Changes to catch the retirement requester in automate.
    (cherry picked from commit 7856a59838008f3d651a81f994c193a792d2c670)

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

 app/models/mixins/retirement_mixin.rb | 13 +-
 spec/models/vm/retirement_management_spec.rb | 15 +-
 2 files changed, 24 insertions(+), 4 deletions(-)

Comment 3 Brandon Squizzato 2018-04-02 15:48:13 UTC
Verified on 5.9.2.0.20180320210136_355c506 by retiring a VM via REST API with a POST to /api/vms/<vm ID> and data {'action': 'retire'}

'userid' attribute was visible and 'retirement_initiator' was "user" for this request, as seen in miq_ae_tools/log:

----] I, [2018-04-02T11:35:36.178898 #11916:d55138]  INFO -- : <AEMethod [/ManageIQ/Infrastructure/VM/Retirement/StateMachines/Methods/start_retirement]> Starting 
[----] I, [2018-04-02T11:35:36.648675 #11916:e39978]  INFO -- : <AEMethod start_retirement> Listing Root Object Attributes:

<...snipped...>

start_retirement> 	retirement_initiator: user
[----] I, [2018-04-02T11:35:36.675674 #11916:1118568]  INFO -- : <AEMethod start_retirement> 	tenant: #<MiqAeMethodService::MiqAeServiceTenant:0x0000000cd32028>
[----] I, [2018-04-02T11:35:36.676537 #11916:1118568]  INFO -- : <AEMethod start_retirement> 	type: ManageIQ::Providers::Microsoft::InfraManager::Vm
[----] I, [2018-04-02T11:35:36.677906 #11916:1118568]  INFO -- : <AEMethod start_retirement> 	user: #<MiqAeMethodService::MiqAeServiceUser:0x0000000cd328c0>
[----] I, [2018-04-02T11:35:36.679051 #11916:1118568]  INFO -- : <AEMethod start_retirement> 	user_id: 1
[----] I, [2018-04-02T11:35:36.679911 #11916:1118568]  INFO -- : <AEMethod start_retirement> 	userid: admin

Comment 6 errata-xmlrpc 2018-05-07 20:44:14 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