Bug 1837866

Summary: "Configure Cloud Connector" sometimes finds incorrect account
Product: Red Hat Satellite Reporter: Jan Hutař <jhutar>
Component: RH Cloud - Cloud ConnectorAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7.0CC: ahumbe, aruzicka, bbuckingham, egolov
Target Milestone: 6.8.0   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ansiblerole-satellite-receptor-installer-0.6.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-29 15:10:41 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:
Attachments:
Description Flags
output of the job run with some debugs added, most importantly on "sat_org_subscriptions.json" none

Description Jan Hutař 2020-05-20 07:44:00 UTC
Created attachment 1690089 [details]
output of the job run with some debugs added, most importantly on "sat_org_subscriptions.json"

Description of problem:
"Configure Cloud Connector" sometimes finds incorrect account, because it takes `sat_org_subscriptions.json | json_query('results[0].account_number')` and in my case `results[0]` is custom subscription which do not have account number.


Version-Release number of selected component (if applicable):
satellite-6.7.0-7.el7sat.noarch
ansiblerole-satellite-receptor-installer-0.6.4-1.el7sat.noarch
tfm-rubygem-foreman_rh_cloud-1.0.4.1-2.el7sat.noarch
python3-receptor-satellite-1.0.1-1.el7sat.noarch
receptor-0.6.1-1.el7ar.noarch


How reproducible:
always on my setup


Steps to Reproduce:
1. I had Receptor working
2. I deleted manifest and uploaded new one
3. Somewhere in the process (before or after uploading new manifest), I have created few custom products and repos
4. I reran "Configure Cloud Connector" playbook

But maybe you can also reproduce with creating a custom product on clean satellite/organization before you upload manifest and run "Configure Cloud Connector" - hopefully this will position custom product on a first position of `results` array in that API response


Actual results:
Account is detected as null, which causes rest of the playbook to not do what is expected - see attached output with debug on variable "sat_org_subscriptions.json" that should the problem clear (first item in `results` do not have account, second do)


Expected results:
Account should be detected correctly, even if first `results` item have null account

Comment 1 Adam Ruzicka 2020-05-20 07:48:55 UTC
This should be fixed in ansiblerole-satellite-receptor-installer-0.6.5, moving to POST

Comment 2 Lukáš Hellebrandt 2020-06-03 11:39:24 UTC
Brad, is this BZ for 6.7.z or 6.8? It has both flags.

Comment 4 Brad Buckingham 2020-06-23 09:37:45 UTC
Hi Lukáš,

It is proposed for both releases.  The ON_QA is for 6.8 (Target Milestone = 6.8.0).  If the BZ is selected for the zstream during zstream triage, it will be 'cloned' for a specific 6.7.z and then Target Milestone set (e.g. 6.7.2).

thanks,
Brad