Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1640689

Summary: purpose compliance event gives mismatch reason for null SLA
Product: [Community] Candlepin (Migrated to Jira) Reporter: Kevin Howell <khowell>
Component: candlepinAssignee: Nikos Moumoulidis <nmoumoul>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: high    
Version: 2.5CC: candlepin-bugs, jturel, katello-qa-list, khowell, nmoumoul, redakkan, skallesh
Target Milestone: ---Keywords: Triaged
Target Release: 2.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: candlepin-2.3.11-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1640215 Environment:
Last Closed: 2018-11-28 19:24:32 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:

Description Kevin Howell 2018-10-18 14:19:58 UTC
+++ This bug was initially created as a clone of Bug #1640215 +++

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"}}]

--- Additional comment from Jonathon Turel on 2018-10-17 13:56:31 EDT ---

Forgot to mention I saw this on 2.5.7

--- Additional comment from Kevin Howell on 2018-10-18 10:17:24 EDT ---

Dev, let's eliminate the legacy handling of empty string in Candlepin.

--- Additional comment from Kevin Howell on 2018-10-18 10:18:43 EDT ---

> Dev, let's eliminate the legacy handling of empty string in Candlepin.

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