Bug 1621885

Summary: Cannot add Ansible Tower or refresh already added Ansible Tower
Product: Red Hat CloudForms Management Engine Reporter: David Luong <dluong>
Component: ProvidersAssignee: Bronagh Sorota <bsorota>
Status: CLOSED CURRENTRELEASE QA Contact: Nandini Chandra <nachandr>
Severity: high Docs Contact:
Priority: high    
Version: 5.9.3CC: dluong, dmetzger, gblomqui, jfrey, jhardy, obarenbo, simaishi, smallamp
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.10.0.15 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1629129 (view as bug list) Environment:
Last Closed: 2019-02-12 16:50:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1629129    

Description David Luong 2018-08-23 19:16:38 UTC
Description of problem:
Cannot add new Ansible Tower or refresh already ansible tower due to credentials without usernames.

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

How reproducible:
Always

Steps to Reproduce:
1.  Have a tower instance with credentials without usernames
2.  Attempt to add Tower provider or refresh Tower provider
3.

Actual results:
Unable to add or refresh

Expected results:
Successful add or refresh

Additional info:

Possible solution would be to change the following line:
https://github.com/ManageIQ/manageiq-providers-ansible_tower/blob/aca6bd12d87b7aa1d6f80952da6161eefc377189/app/models/manageiq/providers/ansible_tower/shared/inventory/parser/automation_manager.rb#L125

To:
inventory_object.userid = credential.username || "<no user>"

Comment 4 David Luong 2018-08-24 14:31:05 UTC
PR addressing this bug: https://github.com/ManageIQ/manageiq-providers-ansible_tower/pull/120

Comment 6 CFME Bot 2018-09-06 16:58:28 UTC
New commit detected on ManageIQ/manageiq-providers-ansible_tower/master:

https://github.com/ManageIQ/manageiq-providers-ansible_tower/commit/161df08159f731edfcee0d86dd82c4f2d1c98fd6
commit 161df08159f731edfcee0d86dd82c4f2d1c98fd6
Merge: 7cf45314a0380f8389cba064cc7300876dbbcc9d 78b08fea5267b44fc6f438b1dc097325f563d9bd
Author:     Adam Grare <agrare>
AuthorDate: Tue Aug 14 15:10:56 2018 -0400
Commit:     Adam Grare <agrare>
CommitDate: Tue Aug 14 15:10:56 2018 -0400

    Deal with ansible not having a username

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

 CHANGELOG.md | 6 +
 app/models/manageiq/providers/ansible_tower/shared/inventory/parser/automation_manager.rb | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

Comment 10 Nandini Chandra 2018-10-03 22:39:25 UTC
Unable to reproduce the issue locally without fix.

Marking the BZ as VERIFIED since the fix resolved the issue for the customer.