Bug 749332

Summary: subscription-manager returns different error messages for same issue
Product: Red Hat Enterprise Linux 5 Reporter: Eric Sammons <esammons>
Component: subscription-managerAssignee: Bryan Kearney <bkearney>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: low Docs Contact:
Priority: medium    
Version: 5.8CC: bkearney, cduryee, jmolet, jsefler, skallesh, wpoteat
Target Milestone: rc   
Target Release: 5.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 0.98.5-1.el5 Doc Type: Bug Fix
Doc Text:
No description necessary
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 06:42:25 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, 769266    
Attachments:
Description Flags
Very simple patch, minimal testing conducted. Could still use a new line for neatness. none

Description Eric Sammons 2011-10-26 18:13:59 UTC
Description of problem:
When attempting to execute a task with subscription-manager on a unregistered system, different tasks may trigger different errors for the exact same issue; Unregistered system.

Version-Release number of selected component (if applicable):
subscription-manager-0.96.12-1.el6.x86_64

How reproducible:
Everytime


Steps to Reproduce:
1. Run a couple of commands on a system that is unregistered, for example.
# subscription-manager refresh
Error: You need to register this system by running `register` command before using this option.
# subscription-manager redeem
Error: You need to register this system by running `register` command before using this option.
2. Run the following command and note the result, same meaning but different message.
# subscription-manager identity
Consumer not registered. Please register using --username and --password


Expected results:
For a system that is unregistered, the error message should be consistent indicating that the machine is unregistered and perhaps a possible solution, similar to no. 1 above.

Additional info:
I have attached a simple patch; however, I believe this space could still be cleaned up, as is the error is multi-line should include \n.  I have done minimal testing with this patch.

Comment 1 John Sefler 2011-10-26 18:28:13 UTC
Moreover these error messages should be consistently written to stderr with exitCode 255

Comment 2 Eric Sammons 2011-10-26 18:31:01 UTC
Created attachment 530354 [details]
Very simple patch, minimal testing conducted.  Could still use a new line for neatness.

Comment 3 Eric Sammons 2011-10-26 18:32:17 UTC
patch could easily be modified to change sys.exit(-1) to sys.exit(255).

Comment 7 Shwetha Kallesh 2011-11-24 07:18:48 UTC
Moving the bug to verified..

RPM used:

[root@tiger ~]# rpm -qa | grep subscription-manager
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-migration-0.98.3-1.git.16.14460bc.el5_7
subscription-manager-0.98.3-1.git.16.14460bc.el5_7

Steps to reproduce:

[root@tiger ~]# subscription-manager identity
Error: You need to register this system by running `register` command.  Try register --help.

[root@tiger ~]# subscription-manager refresh
Error: You need to register this system by running `register` command.  Try register --help.

[root@tiger ~]# subscription-manager redeem
Error: You need to register this system by running `register` command.  Try register --help.

Comment 8 William Poteat 2012-01-23 13:43:37 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 9 errata-xmlrpc 2012-02-21 06:42:25 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