Bug 855257

Summary: In "Choose the specific contract to use" dialog,total subscription is 5 ,where as quantity available is 15
Product: Red Hat Enterprise Linux 5 Reporter: Shwetha Kallesh <skallesh>
Component: subscription-managerAssignee: Adrian Likins <alikins>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.9CC: alikins, awood, bkearney, jmolet, jsefler, skallesh, spandey
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-08 04:03:19 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: 771748    
Attachments:
Description Flags
Available subscription is more than the total
none
screenshot shows that the default quantities in the contract selection dialog are capped by their remaining quantity. none

Description Shwetha Kallesh 2012-09-07 06:49:56 UTC
Created attachment 610635 [details]
Available subscription is more than the total

Description of problem:
In "Choose the specific contract to use" dialog,total subscription is 5 ,where as quantity available is 15 

Version-Release number of selected component (if applicable):
[root@unused ~]# rpm -qa | grep subscription-manager
subscription-manager-gui-1.0.17-1.el5
subscription-manager-firstboot-1.0.17-1.el5
subscription-manager-1.0.17-1.el5
subscription-manager-migration-1.0.17-1.el5
subscription-manager-migration-data-1.11-1.el5
subscription-manager-debuginfo-1.0.17-1.el5


How reproducible:


Steps to Reproduce:
1.Subscription-manager-gui
2.In All Available Subscriptions Tab,select a multi-entitled subscription
3.click on subscribe
  
Actual results:
In the Attachment

Expected results:
Maximum Quantity available for subscription should be equal to the Total 

Additional info:

Comment 1 Shwetha Kallesh 2012-09-07 07:23:13 UTC
Steps to Reproduce:
1.Subscription-manager-gui
2.In All Available Subscriptions Tab,select a multi-entitled subscription
3.Increase the quantity to max available
4.click on subscribe

Comment 2 Adrian Likins 2012-09-20 20:13:23 UTC
Looks like if you "click to adjust quantity" it will default to the right number in the spin button, so the info is there. 

Checking..

Comment 3 Adrian Likins 2012-10-05 20:17:47 UTC
(in master, to be cherry-picked)
commit cd74e008c7ec171c43d629c826b010a461f5897a
Author: Adrian Likins <alikins>
Date:   Wed Sep 26 17:08:36 2012 -0400

    855257: fix issues with default contract quantity being wrong
    
    Cap at quantity of pool from each contract instead of
    total request quantity.

Comment 4 RHEL Program Management 2012-10-05 20:38:17 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 6 John Sefler 2012-10-15 19:15:08 UTC
Using subscriptions from the imported TESTDATA to verify version...
[root@jsefler-rhel59 ~]# rpm -q subscription-manager-gui
subscription-manager-gui-1.0.22-1.el5


CREATE A FAKE FACTS FILE TO SIMULATE A 9 SOCKET SYSTEM....
[root@jsefler-rhel59 ~]# echo '{"cpu.cpu_socket(s)":9}' > /etc/rhsm/facts/fake.facts
[root@jsefler-rhel59 ~]# subscription-manager facts --list | grep cpu.cpu_socket
cpu.cpu_socket(s): 9
[root@jsefler-rhel59 ~]# 

[root@jsefler-rhel59 ~]# subscription-manager register --username testuser1 --org admin
Password: 
The system has been registered with id: 6934a42b-4718-49cc-9e1a-6df18ced6622 

SUBSCRIBE TO 2 OF THE POOLS SO THAT A QUANTITY OF 7 REMAINS NEEDED FOR SOCKET COMPLIANCE...
[root@jsefler-rhel59 ~]# subscription-manager list --avail | grep 8a90f81d3a61c156013a61c33f3e03b7 -A1 -B2
Subscription Name:    	Awesome OS for x86_64
SKU:                  	awesomeos-x86_64
Pool Id:              	8a90f81d3a61c156013a61c33f3e03b7
Quantity:             	10
[root@jsefler-rhel59 ~]# subscription-manager list --avail | grep 8a90f81d3a61c156013a61c33f0003ac -A1 -B2
Subscription Name:    	Awesome OS for x86_64
SKU:                  	awesomeos-x86_64
Pool Id:              	8a90f81d3a61c156013a61c33f0003ac
Quantity:             	5
[root@jsefler-rhel59 ~]# subscription-manager subscribe --pool 8a90f81d3a61c156013a61c33f3e03b7 --pool 8a90f81d3a61c156013a61c33f0003ac
Successfully consumed a subscription for: Awesome OS for x86_64
Successfully consumed a subscription for: Awesome OS for x86_64

START THE GUI AND GO TO THE AVAILABLE SUBSCRIPTIONS, CLICK UPDATE, UNCHECK THE "have no overlap with existing subscriptions" FILTER AND LOOK FOR "Awesome OS for x86_64".

NOW LOOK AT THE ATTACHED SCREEN WHERE WE SEE THAT THE DEFAULT QUANTITY IS CAPPED AT IT MAXIMUM AVAILABLE UNUSED QUANTITY (4) AND THE OTHER CONTRACT'S DEFAULT QUANTITY IS EXACTLY WHAT IS NEEDED TO SATISFY THE REMAINING SOCKETS (7) WHICH IS WITHIN THE AVAILABLE UNUSED QUANTITY LEFT ON THAT CONTRACT.

Comment 7 John Sefler 2012-10-15 19:32:04 UTC
Created attachment 627633 [details]
screenshot shows that the default quantities in the contract selection dialog are capped by their remaining quantity.

Comment 8 John Sefler 2012-10-15 19:32:52 UTC
Moving to VERIFIED

Comment 9 J.C. Molet 2012-10-15 20:05:54 UTC
This is a dupe of both Bug 760618 (closed WONTFIX, change of heart?) and "case 2" in Bug 766778 .

Comment 11 errata-xmlrpc 2013-01-08 04:03:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0033.html