Bug 681287

Summary: GET /pools?consumer=uuid&listall should not return pools that are consumed or cause errors/failure
Product: [Community] Candlepin Reporter: Amanda Carter <acarter>
Component: candlepinAssignee: Devan Goodwin <dgoodwin>
Status: CLOSED CURRENTRELEASE QA Contact: John Sefler <jsefler>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.5CC: acarter, bkearney, dgoodwin, ggainey
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-17 13:03:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Amanda Carter 2011-03-01 16:59:07 UTC
Description of problem:

When users select the 'all' filter for subscriptions, they are literally given all with no filter. This includes things like pools that are completely consumed which will just fail if the user tries to subscribe to them. JBowes also mentioned other scenarios that may cause error and are not currently filtered.


Steps to Reproduce:

1. Go here: https://ggainey.rhel6rails.gss.devlab.phx1.redhat.com/management/consumers/656b0ee6-dca6-4802-a00c-c07fcca1aa88

2. Login as xeops / redhatfgbi3OjR

3. Play around w/the "Available Subscriptions" tab
  


Actual results:

User is given pools that are already consumed. 


Expected results:

User is shown all that are available but not consumed, without filtering against hardware. This does not take into account any additional error cases that are identified.
Additional info:

Comment 1 Grant Gainey 2011-03-01 18:07:05 UTC
Note that the link above is to my development box - stability is far from guaranteed!

Comment 2 Devan Goodwin 2011-03-03 20:46:48 UTC
There was a bit of a logic error doing a GET /pools with ?consumer=UUID as well as listall=true. We were tossing away the consumer UUID and instead just listing everything for the owner, no rules check was being done to determine if the pool was suitable for this consumer. (in which case we really shouldn't ask for pools specific to this consumer, rather everything for the owner) 

Instead we now keep the UUID and thus run a rules check on each pool. If the rules generate an error (i.e. pool is exhausted, consumer already has an entitlement for the pool, consumer type mismatch, etc), the pool will be omitted. Warnings will still be included provided listall was specified.

Fixed in candlepin.git master as of: e7fda2ad04981c9c99d4810883dd9926134303b1
Should appear in: candlepin-0.2.10

Comment 3 Devan Goodwin 2011-03-03 20:47:32 UTC
*** Bug 679872 has been marked as a duplicate of this bug. ***

Comment 7 Bryan Kearney 2012-07-17 13:03:29 UTC
Marking all community bugs modified or beyong as closed.