Bug 665118 - Refresh pools will not notice change in provided products
Summary: Refresh pools will not notice change in provided products
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: ---
Assignee: Devan Goodwin
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: 568421 Entitlement-Beta
TreeView+ depends on / blocked
 
Reported: 2010-12-22 19:37 UTC by Bryan Kearney
Modified: 2015-05-14 15:21 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-30 20:43:49 UTC
Embargoed:


Attachments (Terms of Use)

Description Bryan Kearney 2010-12-22 19:37:17 UTC
Refresh pools will check to see if the provided products are different. However, it does not mutate the subscription with the changed provided products. 

To recreate, change the provided products in the DB, call refresh pools, and see nothing happen.

Comment 1 Devan Goodwin 2011-01-13 19:10:21 UTC
Fixed in candlepin.git master: 72738c3907b8471134ee93c1fed3e930ab25d22e
BETA: f8fc512269f80198beb7dc0957e590d7022d11dd

Comment 2 John Sefler 2011-04-11 16:54:15 UTC
Verifing Candlepin Version...
[root@jsefler-f14-candlepin candlepin]# git branch
* 0.2
  master
[root@jsefler-f14-candlepin candlepin]# git show-ref 0.2
f5161b2e7ee085aaa10130f524d05d0cd461e310 refs/heads/0.2
9c13d6bf6d83070bbc78638f6ca3bc1dc5267977 refs/remotes/origin/0.2
[root@jsefler-f14-candlepin candlepin]# git log | grep 72738c3907b8471134ee93c1fed3e930ab25d22e
commit 72738c3907b8471134ee93c1fed3e930ab25d22e


ON THE CLIENT...
[root@jsefler-onprem-server ~]# subscription-manager register --username=testuser1 --password=password
ebf6289a-7e5a-4605-a1ee-7c8a271d176b jsefler-onprem-server.usersys.redhat.com

[root@jsefler-onprem-server ~]# subscription-manager list --avail | grep 8a90f8b42f44b46b012f44b515a00177 -A3 -B1
ProductId:         	awesomeos-server-2-socket-bas
PoolId:            	8a90f8b42f44b46b012f44b515a00177
Quantity:          	10                       
Expires:           	2012-04-09      

[root@jsefler-onprem-server ~]# curl -u admin:admin -k https://jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin/owners/admin/pools | python -mjson.tool | grep  8a90f8b42f44b46b012f44b515a00177 -B8 -A64
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 60864    0 60864    0     0   235k      0 --:--:-- --:--:-- --:--:--  371k
    {
        "accountNumber": "12331131231", 
        "activeSubscription": true, 
        "attributes": [], 
        "consumed": 0, 
        "contractNumber": "28", 
        "created": "2011-04-11T13:16:48.928+0000", 
        "endDate": "2012-04-10T00:00:00.000+0000", 
        "href": "/pools/8a90f8b42f44b46b012f44b515a00177", 
        "id": "8a90f8b42f44b46b012f44b515a00177", 
        "owner": {
            "href": "/owners/admin", 
            "id": "8a90f8b42f44b46b012f44b4b26e0005"
        }, 
        "productId": "awesomeos-server-2-socket-bas", 
        "productName": "Awesome OS Server Bundled (2 Sockets, L1-L3, Basic Support)", 
        "providedProducts": [
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a1017b", 
                "productId": "awesomeos-server", 
                "productName": "Awesome OS Server Bundled", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a1017e", 
                "productId": "37065", 
                "productName": "Clustering Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a1017c", 
                "productId": "37070", 
                "productName": "Load Balancing Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a1017d", 
                "productId": "37060", 
                "productName": "Awesome OS Server Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a1017a", 
                "productId": "37067", 
                "productName": "Shared Storage Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a10178", 
                "productId": "37069", 
                "productName": "Management Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a10179", 
                "productId": "37068", 
                "productName": "Large File Support Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }
        ], 
        "quantity": 10, 
        "restrictedToUsername": null, 
        "sourceEntitlement": null, 
        "startDate": "2011-04-11T00:00:00.000+0000", 
        "subscriptionId": "8a90f8b42f44b46b012f44b4fdf700ce", 
        "updated": "2011-04-11T13:16:48.928+0000"
    }, 


ON THE CANDLEPIN SERVER...

[root@jsefler-f14-candlepin candlepin]# su - postgres
-bash-4.1$ psql candlepin
psql (8.4.7)
Type "help" for help.

candlepin=# select * from cp_subscription_products where subscription_id='8a90f8b42f44b46b012f44b4fdf700ce';
         subscription_id          |    product_id    
----------------------------------+------------------
 8a90f8b42f44b46b012f44b4fdf700ce | 37065
 8a90f8b42f44b46b012f44b4fdf700ce | awesomeos-server
 8a90f8b42f44b46b012f44b4fdf700ce | 37060
 8a90f8b42f44b46b012f44b4fdf700ce | 37070
 8a90f8b42f44b46b012f44b4fdf700ce | 37068
 8a90f8b42f44b46b012f44b4fdf700ce | 37067
 8a90f8b42f44b46b012f44b4fdf700ce | 37069
(7 rows)

candlepin=#  delete from cp_subscription_products where subscription_id='8a90f8b42f44b46b012f44b4fdf700ce' and product_id='37068';
DELETE 1

candlepin=# select * from cp_subscription_products where subscription_id='8a90f8b42f44b46b012f44b4fdf700ce';         subscription_id          |    product_id    
----------------------------------+------------------
 8a90f8b42f44b46b012f44b4fdf700ce | 37065
 8a90f8b42f44b46b012f44b4fdf700ce | awesomeos-server
 8a90f8b42f44b46b012f44b4fdf700ce | 37060
 8a90f8b42f44b46b012f44b4fdf700ce | 37070
 8a90f8b42f44b46b012f44b4fdf700ce | 37067
 8a90f8b42f44b46b012f44b4fdf700ce | 37069
(6 rows)

BACK ON THE CLIENT...

[root@jsefler-onprem-server ~]# curl -u admin:admin -k https://jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin/owners/admin/pools | python -mjson.tool | grep  8a90f8b42f44b46b012f44b515a00177 -B8 -A64
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 60864    0 60864    0     0   266k      0 --:--:-- --:--:-- --:--:--  433k
    {
        "accountNumber": "12331131231", 
        "activeSubscription": true, 
        "attributes": [], 
        "consumed": 0, 
        "contractNumber": "28", 
        "created": "2011-04-11T13:16:48.928+0000", 
        "endDate": "2012-04-10T00:00:00.000+0000", 
        "href": "/pools/8a90f8b42f44b46b012f44b515a00177", 
        "id": "8a90f8b42f44b46b012f44b515a00177", 
        "owner": {
            "href": "/owners/admin", 
            "id": "8a90f8b42f44b46b012f44b4b26e0005"
        }, 
        "productId": "awesomeos-server-2-socket-bas", 
        "productName": "Awesome OS Server Bundled (2 Sockets, L1-L3, Basic Support)", 
        "providedProducts": [
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a1017c", 
                "productId": "37070", 
                "productName": "Load Balancing Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a1017a", 
                "productId": "37067", 
                "productName": "Shared Storage Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a1017b", 
                "productId": "awesomeos-server", 
                "productName": "Awesome OS Server Bundled", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a1017d", 
                "productId": "37060", 
                "productName": "Awesome OS Server Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a1017e", 
                "productId": "37065", 
                "productName": "Clustering Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a10178", 
                "productId": "37069", 
                "productName": "Management Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }, 
            {
                "created": "2011-04-11T13:16:48.929+0000", 
                "id": "8a90f8b42f44b46b012f44b515a10179", 
                "productId": "37068", 
                "productName": "Large File Support Bits", 
                "updated": "2011-04-11T13:16:48.929+0000"
            }
        ], 
        "quantity": 10, 
        "restrictedToUsername": null, 
        "sourceEntitlement": null, 
        "startDate": "2011-04-11T00:00:00.000+0000", 
        "subscriptionId": "8a90f8b42f44b46b012f44b4fdf700ce", 
        "updated": "2011-04-11T13:16:48.928+0000"
    }, 

^^^ provided product 37068 is still there as expected since we haven't refreshed pools yet
Now let's refresh pools...

[root@jsefler-onprem-server ~]# curl -u admin:admin -k --request PUT https://jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin/owners/admin/subscriptions | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
140   280    0   280    0     0   3419      0 --:--:-- --:--:-- --:--:-- 10370
{
    "created": "2011-04-11T16:33:37.163+0000", 
    "finishTime": null, 
    "id": "refresh_pools_b15e994d-fd27-4ae7-acd5-072c278b5842", 
    "result": null, 
    "startTime": null, 
    "state": "CREATED", 
    "statusPath": "/jobs/refresh_pools_b15e994d-fd27-4ae7-acd5-072c278b5842", 
    "updated": "2011-04-11T16:33:37.163+0000"
}


[root@jsefler-onprem-server ~]# curl -u admin:admin -k https://jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin/owners/admin/pools | python -mjson.tool | grep  8a90f8b42f44b46b012f44b515a00177 -B8 -A57
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 60680    0 60680    0     0   275k      0 --:--:-- --:--:-- --:--:--  395k
    {
        "accountNumber": "12331131231", 
        "activeSubscription": true, 
        "attributes": [], 
        "consumed": 0, 
        "contractNumber": "28", 
        "created": "2011-04-11T13:16:48.928+0000", 
        "endDate": "2012-04-10T00:00:00.000+0000", 
        "href": "/pools/8a90f8b42f44b46b012f44b515a00177", 
        "id": "8a90f8b42f44b46b012f44b515a00177", 
        "owner": {
            "href": "/owners/admin", 
            "id": "8a90f8b42f44b46b012f44b4b26e0005"
        }, 
        "productId": "awesomeos-server-2-socket-bas", 
        "productName": "Awesome OS Server Bundled (2 Sockets, L1-L3, Basic Support)", 
        "providedProducts": [
            {
                "created": "2011-04-11T16:32:41.887+0000", 
                "id": "8a90f8b42f44b46b012f45686b9f0d03", 
                "productId": "37069", 
                "productName": "Management Bits", 
                "updated": "2011-04-11T16:32:41.887+0000"
            }, 
            {
                "created": "2011-04-11T16:32:41.887+0000", 
                "id": "8a90f8b42f44b46b012f45686b9f0d07", 
                "productId": "awesomeos-server", 
                "productName": "Awesome OS Server Bundled", 
                "updated": "2011-04-11T16:32:41.887+0000"
            }, 
            {
                "created": "2011-04-11T16:32:41.887+0000", 
                "id": "8a90f8b42f44b46b012f45686b9f0d04", 
                "productId": "37060", 
                "productName": "Awesome OS Server Bits", 
                "updated": "2011-04-11T16:32:41.887+0000"
            }, 
            {
                "created": "2011-04-11T16:32:41.887+0000", 
                "id": "8a90f8b42f44b46b012f45686b9f0d05", 
                "productId": "37065", 
                "productName": "Clustering Bits", 
                "updated": "2011-04-11T16:32:41.887+0000"
            }, 
            {
                "created": "2011-04-11T16:32:41.887+0000", 
                "id": "8a90f8b42f44b46b012f45686b9f0d06", 
                "productId": "37070", 
                "productName": "Load Balancing Bits", 
                "updated": "2011-04-11T16:32:41.887+0000"
            }, 
            {
                "created": "2011-04-11T16:32:41.887+0000", 
                "id": "8a90f8b42f44b46b012f45686b9f0d02", 
                "productId": "37067", 
                "productName": "Shared Storage Bits", 
                "updated": "2011-04-11T16:32:41.887+0000"
            }
        ], 
        "quantity": 10, 
        "restrictedToUsername": null, 
        "sourceEntitlement": null, 
        "startDate": "2011-04-11T00:00:00.000+0000", 
        "subscriptionId": "8a90f8b42f44b46b012f44b4fdf700ce", 
        "updated": "2011-04-11T13:16:48.928+0000"
    }, 
[root@jsefler-onprem-server ~]# 


^^^ VERIFIED.  The subscription's provided product '37068' that we deleted from the database was indeed removed from the corresponding pool after we called refresh pools.

Comment 3 John Sefler 2011-05-04 14:40:23 UTC
Group move of VERIFIED Candlepin component bugs to RELEASE_PENDING


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