Bug 1652106

Summary: syspurpose compliance mismatch for role
Product: [Community] Candlepin Reporter: Nikos Moumoulidis <nmoumoul>
Component: candlepinAssignee: candlepin-bugs
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.5CC: redakkan, skallesh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1652107 (view as bug list) Environment:
Last Closed: 2018-11-21 16:16:01 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: 1652107    

Description Nikos Moumoulidis 2018-11-21 15:34:09 UTC
Description of problem:
The consumer's syspurpose compliance is calculated wrong when the pool he is attached to has at least one role in common with the one he specified.

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


How reproducible:
100%

Steps to Reproduce:

- Have a consumer with installed product "product1" and set syspurpose role to "myrole".
- Attach directly to a pool which provides product1, which has its roles product attribute set to "myrole"
- Query the syspurpose compliance.


Actual results:
The syspurpose compliance returned has status 'invalid', and has 1 item in 'partiallyCompliantProducts' and 1 item in 'reasons'.

Expected results:
The syspurpose compliance returned should have status 'valid', and should have no 'partiallyCompliantProducts' or 'reasons', since the pool supports the role that the consumer has specified (myrole).

Additional info:

The problem is in rules.js, which uses the product attribute name 'role' instead of 'roles'.