Bug 1335989

Summary: Automate: customize_request method in Redhat domain incorrect sets security_group value in options hash
Product: Red Hat CloudForms Management Engine Reporter: Greg McCullough <gmccullo>
Component: AutomateAssignee: William Fitzgerald <wfitzger>
Status: CLOSED ERRATA QA Contact: Milan Falešník <mfalesni>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.6.0CC: cpelland, dajohnso, jcutter, jhardy, mkanoor, obarenbo, simaishi, tfitzger
Target Milestone: GAKeywords: ZStream
Target Release: 5.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: automate:provision
Fixed In Version: 5.9.0.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1565760 (view as bug list) Environment:
Last Closed: 2018-03-01 13:06:56 UTC Type: Bug
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:    
Bug Blocks: 1565760    

Description Greg McCullough 2016-05-13 18:19:34 UTC
Description of problem:
When using the customize request method (either amazon_customizerequest or openstack_customizerequest) from the RedHat domain and passing the security_group name as part of additional values 


Version-Release number of selected component (if applicable): 5.6


How reproducible: Always


Steps to Reproduce:
1. Copy the "customize request" method to a writable domain and modify the mapping setting from mapping = 0 to mapping = 1.
2. Create a REST API call to provision an Amazon or OpenStack instance and pass the "security_group" value with the name in "additional_values" that you want to apply.
3. Check the request that was created and verify that the security group was not applied.


Actual results:
Specified security group is ignored.

Expected results:
Specified security group gets set.

Additional info:
Additional details https://bugzilla.redhat.com/show_bug.cgi?id=1297335#c18
The script from https://github.com/ManageIQ/manageiq/pull/8425 can be used to help build the Rest API call for provisioning.


This can be corrected by changing:
  prov.set_option(:security_groups, [securitygroup.name])
to
  prov.set_option(:security_groups, [securitygroup.id])

Comment 2 CFME Bot 2017-07-11 15:36:27 UTC
New commit detected on cfme_productization/master:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme_productization.git;a=commit;h=169d47708dd133eb95be957ad7e4564cc0cdfc10

commit 169d47708dd133eb95be957ad7e4564cc0cdfc10
Author:     william fitzgerald <wfitzger>
AuthorDate: Mon May 22 17:45:24 2017 -0400
Commit:     william fitzgerald <wfitzger>
CommitDate: Mon May 22 17:45:24 2017 -0400

    Automate - Changed security_groups to id in 2 custom request methods.
    
    Changed to "securitygroup.id" for both methods.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1335989

 .../StateMachines/Methods.class/__methods__/amazon_customizerequest.rb  | 2 +-
 .../Methods.class/__methods__/openstack_customizerequest.rb             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comment 3 Milan Falešník 2017-11-08 15:22:25 UTC
Verified in 5.9.0.5

Comment 4 Greg McCullough 2018-02-20 22:27:09 UTC
*** Bug 1547249 has been marked as a duplicate of this bug. ***

Comment 7 errata-xmlrpc 2018-03-01 13:06:56 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:0380