Bug 1640215

Summary: purpose compliance event gives mismatch reason for null SLA
Product: [Community] Candlepin Reporter: Jonathon Turel <jturel>
Component: candlepinAssignee: candlepin-bugs
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: high    
Version: 2.5CC: awood, bcourt, khowell, redakkan, skallesh
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: candlepin-2.6.1-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1640688 1640689 (view as bug list) Environment:
Last Closed: 2019-01-23 16:56:08 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: 1650635, 1654094    

Description Jonathon Turel 2018-10-17 14:51:33 UTC
Description of problem:

When a consumer has a null service level and a subscription is attached the system_purpose_compliance event is sent. if the attached subscription provides a service level the event will provide a reason indicating a mismatch


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


How reproducible:


Steps to Reproduce:
1. create a consumer and do not set an sla
2. attach a subscription which provides an SLA
3. observe the system purpose compliance event (probably the same through API but didn't check)

Actual results: The compliance event contains a reason, for example: "expected sla is  but pool 4028f935658b81450165a5d4ecd50c9b with product RH00003 provides SLA: Premium"


Expected results: There should not be a mismatch since we didn't set an SLA on the consumer


Additional info:

example event:

{"id":null,"type":"CREATED","target":"SYSTEM_PURPOSE_COMPLIANCE","targetName":"katello-client.jturel.example.com","principalStore":"{\"type\":\"trusteduser\",\"name\":\"foreman_admin\"}","timestamp":1539785096299,"entityId":"08b35f38-7576-40d9-a235-1f8108252695","ownerId":"4028f93563fc914b0163fe5ab16e0001","consumerUuid":"08b35f38-7576-40d9-a235-1f8108252695","referenceId":null,"referenceType":null,"eventData":"{\"reasons\":[\"expected sla is  but pool 4028f935658b81450165a5d4ecd50c9b with product RH00003 provides SLA: Premium\"],\"status\":\"partial\"}","messageText":null,"principal":{"type":"trusteduser","name":"foreman_admin"}}]

Comment 1 Jonathon Turel 2018-10-17 17:56:31 UTC
Forgot to mention I saw this on 2.5.7

Comment 2 Kevin Howell 2018-10-18 14:17:24 UTC
Dev, let's eliminate the legacy handling of empty string in Candlepin.

Comment 3 Kevin Howell 2018-10-18 14:18:43 UTC
> Dev, let's eliminate the legacy handling of empty string in Candlepin.

receiving empty string for SLA should set the SLA to null.