Bug 734114 - register with --org="foo bar" throws a NetworkException instead of a RestlibException
Summary: register with --org="foo bar" throws a NetworkException instead of a RestlibE...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager
Version: 5.7
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: beta
: 5.8
Assignee: Alex Wood
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: 715031
TreeView+ depends on / blocked
 
Reported: 2011-08-29 13:40 UTC by John Sefler
Modified: 2012-02-21 06:31 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No description necessary
Clone Of:
Environment:
Last Closed: 2012-02-21 06:31:36 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0154 normal SHIPPED_LIVE subscription-manager bug fix update 2012-02-20 15:06:04 UTC

Description John Sefler 2011-08-29 13:40:50 UTC
Description of problem:
Although I suspect a valid orgKey cannot contain spaces (is this true?), the following attempt to register with an orgKey containing a space should still throw a RestlibException instead of a NetworkException...


This case is blocked as expected...
# subscription-manager register --username=testuser1 --password=password --org="foo_bar"
Organization/Owner foo_bar does not exist.

This case is blocked as not expected...
# subscription-manager register --username=testuser1 --password=password --org="foo bar"
Network error. Please check the connection details, or see /var/log/rhsm/rhsm.log for more information.

^^^^ EXPECTED RESULT TO BE: Organization/Owner foo bar does not exist.



Version-Release number of selected component (if applicable):
# rpm -q subscription-manager
subscription-manager-0.96.7-1.git.10.586c3c4.el6.x86_64
[root@jsefler-onprem-62candlepin proxy]# git show-ref | grep master
517e1deb46bc6365da35ff12944815208eedb9d6 refs/heads/master
517e1deb46bc6365da35ff12944815208eedb9d6 refs/remotes/origin/master

How reproducible:

Comment 1 John Sefler 2011-08-30 14:03:09 UTC
I suspect the fix for this is to url encode the orgKey when calling the candlepin api.  My guess is that the api path is getting assembled with the requested orgkey "foo bar" which creates an invalid http request when there is a space in the value.

Comment 3 Alex Wood 2011-11-07 21:57:32 UTC
Committed 78110be74fc82def8c694623af8903a282de347c in python-rhsm

Comment 4 Alex Wood 2011-11-07 22:01:24 UTC
Available in versions 0.98.3+

Comment 5 J.C. Molet 2011-11-29 14:41:35 UTC
[root@jmolet-vm4 product]# subscription-manager register --user testuser1 --pass password --org="two words"
Organization two words does not exist.
[root@jmolet-vm4 product]# subscription-manager register --user testuser1 --pass password --org="two_words"
Organization two_words does not exist.


This looks like it works properly now, marking VERIFIED:

[root@jmolet-vm4 product]# rhsm-version 
python-rhsm-0.98.3-1.git.2.74cd6bb.el5_7
subscription-manager-gnome-0.98.3-1.git.16.14460bc.el5_7
subscription-manager-firstboot-0.98.3-1.git.16.14460bc.el5_7
subscription-manager-0.98.3-1.git.16.14460bc.el5_7

candlepin version:

commit 1f4169cab5617b4a3209f13a6cc0f17f6d901e6f
Date:   Fri Nov 11 08:15:33 2011 -0500

Comment 6 William Poteat 2012-01-20 19:21:38 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No description necessary

Comment 7 errata-xmlrpc 2012-02-21 06:31:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0154.html


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