Bug 751116

Summary: Can not list subscriptions from a subscription manager in master
Product: Red Hat Satellite Reporter: Bryan Kearney <bkearney>
Component: APIAssignee: Tomas Strachota <tstrachota>
Status: CLOSED CURRENTRELEASE QA Contact: Jitendra Yejare <jyejare>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: lzap, sghai, tstrachota
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: katello-0.1.98-1.git.13.5a8e341 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-22 18:04:26 UTC Type: ---
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: 747354    

Description Bryan Kearney 2011-11-03 15:04:11 UTC
Using subscription manager from master, I am able to register the machine.. but I can not list subscription. 

Steps to reproduce:
1) Deploy Headpin/Katello containing katello-common-0.1.98-1.git.0.31a0249.fc15.noarch
2) Configure a subscrption-manager to register to the above deployment
3) Register the machine
4) Go to the Available Subscriptions Tab. Click on "update"

The local /var/log/rhsm/rhsm.log shows:

2011-11-03 10:51:46,799 [DEBUG]  @connection.py:209 - Making request: GET /katello/api/owners/ACME_Corporation/pools?consumer=52bbb136-2391-4f68-9254-444b4b938f9f&activeon=2011-11-03T10%3A51%3A46-04%3A00
2011-11-03 10:51:46,955 [DEBUG]  @connection.py:218 - Response status: 401


and the server side /var/log/katello/production.log also shows a 401. The client is using an identity cert to access this URL.

Comment 3 Tomas Strachota 2011-11-04 09:29:06 UTC
There was a problem in the workaround for oauth requests with multiple parameters that have same name. It was affecting also other routes.

commit 5a8e3410569dd36db6db1dc188c5059427421a05
Author: Tomas Strachota <tstrachota>
Date:   Fri Nov 4 09:54:08 2011 +0100

    751116 - can not list subscriptions

Comment 4 Sachin Ghai 2011-11-24 10:01:48 UTC
Verified with following build:

[root@dhcp201-152 yum.repos.d]# rpm -qa | grep katello
katello-cli-common-0.1.13-1.git.31.0d131f9.fc15.noarch
katello-glue-foreman-0.1.112-1.git.5.4e00e02.fc15.x86_64
katello-glue-pulp-0.1.112-1.git.5.4e00e02.fc15.x86_64
katello-configure-0.1.16-1.git.20.8d693e7.fc15.noarch
katello-common-0.1.112-1.git.5.4e00e02.fc15.noarch
katello-0.1.112-1.git.5.4e00e02.fc15.x86_64
katello-all-0.1.112-1.git.5.4e00e02.fc15.x86_64
katello-glue-candlepin-0.1.112-1.git.5.4e00e02.fc15.x86_64
katello-cli-0.1.13-1.git.31.0d131f9.fc15.noarch
katello-repos-0.1.3-1.git.0.db2bd1d.fc15.noarch
[root@dhcp201-152 yum.repos.d]# 


I configured the subscription-manager and register the machine. Now I can see the available subscription in UI as well as in cli. And response state seems to be ok.

[root@dhcp193-155 yum.repos.d]# subscription-manager list --available
+-------------------------------------------+
    Available Subscriptions
+-------------------------------------------+

ProductName:          	pulp                     
ProductId:            	1322122800565            
PoolId:               	8ac1491833d492ff0133d4a8f1660008
Quantity:             	unlimited                
Multi-Entitlement:    	No                       
Expires:              	11/16/2041               
MachineType:          	physical                 

[root@dhcp193-155 yum.repos.d]# 

rhsm.log:
==========
2011-11-24 09:59:32,549 [DEBUG]  @connection.py:209 - Making request: GET /katello/api//owners/ACME_Corporation/pools?consumer=26ee0ed9-d404-4a5b-b826-c3ace86fcc46
2011-11-24 09:59:32,697 [DEBUG]  @connection.py:221 - Response status: 200

production.log:
================
Started GET "/katello//api//owners/ACME_Corporation/pools?consumer=26ee0ed9-d404-4a5b-b826-c3ace86fcc46" for 10.65.193.155 at Thu Nov 24 15:27:07 +0530 2011
  Processing by Api::CandlepinProxiesController#get as JSON
  Parameters: {"consumer"=>"26ee0ed9-d404-4a5b-b826-c3ace86fcc46", "organization_id"=>"ACME_Corporation"}
Rendered text template (0.0ms)
Completed 200 OK in 114ms (Views: 0.6ms | ActiveRecord: 0.0ms)