Bug 734114

Summary: register with --org="foo bar" throws a NetworkException instead of a RestlibException
Product: Red Hat Enterprise Linux 5 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Alex Wood <awood>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.7CC: awood, jmolet, skallesh, spandey, wpoteat
Target Milestone: beta   
Target Release: 5.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
No description necessary
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 06:31:36 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: 715031    

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