Bug 1292283

Summary: Quantity within Subscription is incorrect
Product: [Community] Candlepin Reporter: Shayne Riley <sriley>
Component: candlepinAssignee: candlepin-bugs
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 1.2CC: bcourt, fnguyen, wpoteat
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-22 14:39: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
Differences in the same get subscription call to DEV environment with Pre-CP2.0 and CP2.0 none

Description Shayne Riley 2015-12-16 22:05:47 UTC
Created attachment 1106540 [details]
Differences in the same get subscription call to DEV environment with Pre-CP2.0 and CP2.0

Description of problem:

Since Candlepin 2.0, Subscription's quantity amount is incorrect. For example, if I have a subscription with a Multiplier of 10, and a Quantity of 1, then what I get back from a GET subscription call is a Multiplier of 10 and a Quantity of 10, which is incorrect.


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

Candlepin 2.0


How reproducible:

Always.


Steps to Reproduce:

1. Find a subscription which has a multiplier greater than 1. Not all subscriptions do. However, any subscription for MCT2867 (among others) should have a multiplier greater than 1.

In CP2.0 DEV, we'll use subscriptionId=3781065 (from owner 7791251, pool 8a8798305159a12f01517cb1d9437276):

curl -vku $CP_USER:$CP_PASS -X GET http://candlepin06.web.dev.int.devlab.redhat.com:8080/candlepin/subscriptions/3781065

2. Look at the quantity amount


Actual results:

"quantity": 10


Expected results:

"quantity": 1,


Additional Notes:

The attachment shows this difference. It is a diff of the same call made in the same environment; One was made using a Pre-CP2.0 version, the other using a CP2.0 version.

This bug is similar to BZ1292282. Each bug represents a problematic difference in what the GET subscription call returns between pre-CP2.0 and CP2.0.

Comment 1 Filip Nguyen 2016-01-25 11:07:37 UTC
The problem seems to be that in CP 2.0 we no longer store the subscription data. Instead we create recreate the subscription information from pools and products. The Pool quantity needs to be divided by multiplier of the corresponding product.

Comment 3 Mike McCune 2016-03-28 22:23:05 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 4 Barnaby Court 2016-07-22 14:39:41 UTC
Moving to closed per the updated candlepin process for bugs that have been merged or have been taken care of.