Bug 848836 - extraneous '/' in request urls
Summary: extraneous '/' in request urls
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: python-rhsm
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Devan Goodwin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel510 rhsm-rhel70 rhsm-2013
TreeView+ depends on / blocked
 
Reported: 2012-08-16 14:30 UTC by Dmitri Dolguikh
Modified: 2013-08-01 20:42 UTC (History)
5 users (show)

Fixed In Version: 1.8.2
Clone Of:
Environment:
Last Closed: 2013-08-01 20:42:21 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dmitri Dolguikh 2012-08-16 14:30:46 UTC
Description of problem: 
Subscription manager always appends a trailing slash to request urls, even when 'prefix' parameter in rhsm.conf has url fragment with a trailing slash in it.


Version-Release number of selected component (if applicable):
1.0.10

How reproducible:
append/remove trailing '/' to the 'prefex' parameter, observe urls generated.

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Bryan Kearney 2012-10-17 20:48:05 UTC
setting prefix to be /sam/api I see:

2012-10-17 16:47:26,355 [DEBUG]  @connection.py:355 - Making request: PUT /sam/api/consumers/9a90b716-3e94-4f19-b236-f9c5bb995b0f


setting it to /sam/api/ I see:

2012-10-17 16:48:50,025 [DEBUG]  @connection.py:355 - Making request: GET /sam/api//consumers/9a90b716-3e94-4f19-b236-f9c5bb995b0f

Is the request to strip off the trailing / from /sam/api/?

Comment 2 Bryan Kearney 2012-12-07 21:32:48 UTC
https://github.com/candlepin/python-rhsm/pull/46

Comment 3 Adrian Likins 2012-12-10 15:06:54 UTC
is this breaking anything, or just cosmetic?

Comment 4 Bryan Kearney 2012-12-14 19:34:51 UTC
just cosmetic

Comment 5 Bryan Kearney 2012-12-14 19:35:44 UTC
commit e95956b03f122af2dd0bea97786d4635e7df286e
Author: Bryan Kearney <bkearney>
Date:   Fri Dec 7 16:22:20 2012 -0500

    848836: Remove trailing / from the handler in UEPConnection

Comment 6 Bryan Kearney 2013-02-08 17:18:48 UTC
Fixed in the 1.8.2 version of subscription-manager or python-rhsm

Comment 7 John Sefler 2013-04-12 23:45:27 UTC
Demonstrating issue on version...
[root@rhsm-accept-rhel5 ~]# rpm -q subscription-manager
subscription-manager-1.0.24-1.el5

[root@rhsm-accept-rhel5 ~]# subscription-manager register --username stage_test_12 --serverurl=subscription.rhn.stage.redhat.com:443/subscription
Password: 
The system has been registered with id: 4c476213-1555-4d54-9b30-4cfc36e97b3f 
[root@rhsm-accept-rhel5 ~]# rm -f /var/log/rhsm/rhsm.log

[root@rhsm-accept-rhel5 ~]# subscription-manager config --server.prefix=/subscription
[root@rhsm-accept-rhel5 ~]# subscription-manager list --avail 1>/dev/null
[root@rhsm-accept-rhel5 ~]# grep GET /var/log/rhsm/rhsm.log
2013-04-12 19:33:21,961 [DEBUG]  @connection.py:344 - Making request: GET /subscription/
2013-04-12 19:33:22,556 [DEBUG]  @connection.py:344 - Making request: GET /subscription/
2013-04-12 19:33:23,090 [DEBUG]  @connection.py:344 - Making request: GET /subscription/consumers/4c476213-1555-4d54-9b30-4cfc36e97b3f/owner
2013-04-12 19:33:23,999 [DEBUG]  @connection.py:344 - Making request: GET /subscription/owners/6752574/pools?consumer=4c476213-1555-4d54-9b30-4cfc36e97b3f

[root@rhsm-accept-rhel5 ~]# subscription-manager config --server.prefix=/subscription/
[root@rhsm-accept-rhel5 ~]# subscription-manager list --avail 1>/dev/null
[root@rhsm-accept-rhel5 ~]# grep GET /var/log/rhsm/rhsm.log
2013-04-12 19:33:21,961 [DEBUG]  @connection.py:344 - Making request: GET /subscription/
2013-04-12 19:33:22,556 [DEBUG]  @connection.py:344 - Making request: GET /subscription/
2013-04-12 19:33:23,090 [DEBUG]  @connection.py:344 - Making request: GET /subscription/consumers/4c476213-1555-4d54-9b30-4cfc36e97b3f/owner
2013-04-12 19:33:23,999 [DEBUG]  @connection.py:344 - Making request: GET /subscription/owners/6752574/pools?consumer=4c476213-1555-4d54-9b30-4cfc36e97b3f
2013-04-12 19:34:14,109 [DEBUG]  @connection.py:344 - Making request: GET /subscription//
2013-04-12 19:34:14,678 [DEBUG]  @connection.py:344 - Making request: GET /subscription//
2013-04-12 19:34:15,211 [DEBUG]  @connection.py:344 - Making request: GET /subscription//consumers/4c476213-1555-4d54-9b30-4cfc36e97b3f/owner
2013-04-12 19:34:16,131 [DEBUG]  @connection.py:344 - Making request: GET /subscription//owners/6752574/pools?consumer=4c476213-1555-4d54-9b30-4cfc36e97b3f

[root@rhsm-accept-rhel5 ~]# subscription-manager config --server.prefix=/subscription///////////////////
[root@rhsm-accept-rhel5 ~]# subscription-manager list --avail 1>/dev/null
[root@rhsm-accept-rhel5 ~]# grep GET /var/log/rhsm/rhsm.log
2013-04-12 19:33:21,961 [DEBUG]  @connection.py:344 - Making request: GET /subscription/
2013-04-12 19:33:22,556 [DEBUG]  @connection.py:344 - Making request: GET /subscription/
2013-04-12 19:33:23,090 [DEBUG]  @connection.py:344 - Making request: GET /subscription/consumers/4c476213-1555-4d54-9b30-4cfc36e97b3f/owner
2013-04-12 19:33:23,999 [DEBUG]  @connection.py:344 - Making request: GET /subscription/owners/6752574/pools?consumer=4c476213-1555-4d54-9b30-4cfc36e97b3f
2013-04-12 19:34:14,109 [DEBUG]  @connection.py:344 - Making request: GET /subscription//
2013-04-12 19:34:14,678 [DEBUG]  @connection.py:344 - Making request: GET /subscription//
2013-04-12 19:34:15,211 [DEBUG]  @connection.py:344 - Making request: GET /subscription//consumers/4c476213-1555-4d54-9b30-4cfc36e97b3f/owner
2013-04-12 19:34:16,131 [DEBUG]  @connection.py:344 - Making request: GET /subscription//owners/6752574/pools?consumer=4c476213-1555-4d54-9b30-4cfc36e97b3f
2013-04-12 19:34:42,334 [DEBUG]  @connection.py:344 - Making request: GET /subscription////////////////////
2013-04-12 19:34:42,925 [DEBUG]  @connection.py:344 - Making request: GET /subscription////////////////////
2013-04-12 19:34:43,463 [DEBUG]  @connection.py:344 - Making request: GET /subscription////////////////////consumers/4c476213-1555-4d54-9b30-4cfc36e97b3f/owner
2013-04-12 19:34:44,310 [DEBUG]  @connection.py:344 - Making request: GET /subscription////////////////////owners/6752574/pools?consumer=4c476213-1555-4d54-9b30-4cfc36e97b3f
[root@rhsm-accept-rhel5 ~]# 

The desire is to chomp all of the trailing slashes from the configured prefix.

Comment 8 John Sefler 2013-04-12 23:54:21 UTC
Verifying fix on version...
[root@jsefler-5 ~]# rpm -q subscription-manager
subscription-manager-1.8.5-1.el5

[root@jsefler-5 ~]# subscription-manager register --username=testuser1 --org=admin --serverurl=jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin
Password: 
The system has been registered with id: 6823bf08-8c51-4ca9-aed3-dea3dc453bd8 
[root@jsefler-5 ~]# rm -f /var/log/rhsm/rhsm.log

[root@jsefler-5 ~]# subscription-manager config --server.prefix=/candlepin
[root@jsefler-5 ~]# subscription-manager list --avail 1>/dev/null
[root@jsefler-5 ~]# grep GET /var/log/rhsm/rhsm.log
2013-04-12 19:49:20,731 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:49:20,768 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:49:20,811 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:49:20,987 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:49:21,047 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/consumers/6823bf08-8c51-4ca9-aed3-dea3dc453bd8/owner
2013-04-12 19:49:21,154 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/owners/admin/pools?consumer=6823bf08-8c51-4ca9-aed3-dea3dc453bd8

[root@jsefler-5 ~]# subscription-manager config --server.prefix=/candlepin/
[root@jsefler-5 ~]# subscription-manager list --avail 1>/dev/null
[root@jsefler-5 ~]# grep GET /var/log/rhsm/rhsm.log
2013-04-12 19:49:20,731 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:49:20,768 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:49:20,811 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:49:20,987 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:49:21,047 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/consumers/6823bf08-8c51-4ca9-aed3-dea3dc453bd8/owner
2013-04-12 19:49:21,154 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/owners/admin/pools?consumer=6823bf08-8c51-4ca9-aed3-dea3dc453bd8
2013-04-12 19:49:58,454 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:49:58,486 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:49:58,523 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:49:58,739 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:49:58,801 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/consumers/6823bf08-8c51-4ca9-aed3-dea3dc453bd8/owner
2013-04-12 19:49:58,916 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/owners/admin/pools?consumer=6823bf08-8c51-4ca9-aed3-dea3dc453bd8

[root@jsefler-5 ~]# subscription-manager config --server.prefix=/candlepin///////////////////
[root@jsefler-5 ~]# subscription-manager list --avail 1>/dev/null
[root@jsefler-5 ~]# grep GET /var/log/rhsm/rhsm.log
2013-04-12 19:49:20,731 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:49:20,768 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:49:20,811 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:49:20,987 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:49:21,047 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/consumers/6823bf08-8c51-4ca9-aed3-dea3dc453bd8/owner
2013-04-12 19:49:21,154 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/owners/admin/pools?consumer=6823bf08-8c51-4ca9-aed3-dea3dc453bd8
2013-04-12 19:49:58,454 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:49:58,486 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:49:58,523 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:49:58,739 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:49:58,801 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/consumers/6823bf08-8c51-4ca9-aed3-dea3dc453bd8/owner
2013-04-12 19:49:58,916 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/owners/admin/pools?consumer=6823bf08-8c51-4ca9-aed3-dea3dc453bd8
2013-04-12 19:50:36,467 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:50:36,512 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:50:36,556 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/status
2013-04-12 19:50:36,723 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/
2013-04-12 19:50:36,785 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/consumers/6823bf08-8c51-4ca9-aed3-dea3dc453bd8/owner
2013-04-12 19:50:36,899 [DEBUG]  @connection.py:415 - Making request: GET /candlepin/owners/admin/pools?consumer=6823bf08-8c51-4ca9-aed3-dea3dc453bd8


VERIFIED: No matter how many trailing slashes are configured on the prefix, only a single trailing slash is used in the request urls.

Comment 9 John Sefler 2013-04-12 23:58:33 UTC
Oops, this was the actual package version verified..
[root@jsefler-5 ~]# rpm -q python-rhsm
python-rhsm-1.8.8-1.el5

Comment 10 Fedora End Of Life 2013-07-04 08:04:29 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Fedora End Of Life 2013-08-01 20:42:29 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


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