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.
Moreover these error messages should be consistently written to stderr with exitCode 255
Created attachment 530354 [details] Very simple patch, minimal testing conducted. Could still use a new line for neatness.
patch could easily be modified to change sys.exit(-1) to sys.exit(255).
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.
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
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