Bug 681287 - GET /pools?consumer=uuid&listall should not return pools that are consumed or cause errors/failure
Summary: GET /pools?consumer=uuid&listall should not return pools that are consumed or...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Devan Goodwin
QA Contact: John Sefler
URL:
Whiteboard:
: 679872 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-01 16:59 UTC by Amanda Carter
Modified: 2015-05-14 15:22 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-17 13:03:29 UTC


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.