Bug 848836 - extraneous '/' in request urls
extraneous '/' in request urls
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: python-rhsm (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Devan Goodwin
Fedora Extras Quality Assurance
:
Depends On:
Blocks: rhsm-rhel510 rhsm-rhel70 rhsm-2013
  Show dependency treegraph
 
Reported: 2012-08-16 10:30 EDT by Dmitri Dolguikh
Modified: 2013-08-01 16:42 EDT (History)
5 users (show)

See Also:
Fixed In Version: 1.8.2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-01 16:42:21 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dmitri Dolguikh 2012-08-16 10:30:46 EDT
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 16:48:05 EDT
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 16:32:48 EST
https://github.com/candlepin/python-rhsm/pull/46
Comment 3 Adrian Likins 2012-12-10 10:06:54 EST
is this breaking anything, or just cosmetic?
Comment 4 Bryan Kearney 2012-12-14 14:34:51 EST
just cosmetic
Comment 5 Bryan Kearney 2012-12-14 14:35:44 EST
commit e95956b03f122af2dd0bea97786d4635e7df286e
Author: Bryan Kearney <bkearney@redhat.com>
Date:   Fri Dec 7 16:22:20 2012 -0500

    848836: Remove trailing / from the handler in UEPConnection
Comment 6 Bryan Kearney 2013-02-08 12:18:48 EST
Fixed in the 1.8.2 version of subscription-manager or python-rhsm
Comment 7 John Sefler 2013-04-12 19:45:27 EDT
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 19:54:21 EDT
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 19:58:33 EDT
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 04:04:29 EDT
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 16:42:29 EDT
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.