Bug 965669 - CLI: subscription-manager identity shows -1 when unregistered
CLI: subscription-manager identity shows -1 when unregistered
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: subscription-manager (Show other bugs)
5.10
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: candlepin-bugs
IDM QE LIST
:
: 965666 (view as bug list)
Depends On:
Blocks: rhsm-rhel510 rhsm-rhel70
  Show dependency treegraph
 
Reported: 2013-05-21 09:54 EDT by Sharath Dwaral
Modified: 2015-03-22 21:14 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No description necessary
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-30 19:09:39 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 Sharath Dwaral 2013-05-21 09:54:34 EDT
Description of problem:
When the system is not registered to any candlepin server and we run subscription-manager identity stdout shows -1

Version-Release number of selected component (if applicable):
# rpm -qa | egrep "subscription-manager|python-rhsm"
subscription-manager-gui-1.8.7-1.git.76.63f57ff.el5
python-rhsm-1.8.11-1.git.1.7236cc2.el5
subscription-manager-migration-1.8.7-1.git.76.63f57ff.el5
subscription-manager-1.8.7-1.git.76.63f57ff.el5
subscription-manager-migration-data-1.11.3.1-1.git.1.78afd75.el5
subscription-manager-firstboot-1.8.7-1.git.76.63f57ff.el5


How reproducible:
Always

Steps to Reproduce:
 System in unregistered state

 # subscription-manager identity
This system is not yet registered. Try 'subscription-manager register --help' for more information.
-1

# echo $?
255


Actual results:
This system is not yet registered. Try 'subscription-manager register --help' for more information.
-1

Expected results:
"-1"  Should not be displayed

Additional info:
Comment 1 Sharath Dwaral 2013-05-21 10:19:05 EDT
Also appears when the system is unregistered and you unregister it again

system unregistered

# subscription-manager unregister
This system is currently not registered.
1
[root@dhcp129-152 entitlement]# echo $1
                             <<<< blank


Same version as above

Expected Result:

1 should not appear and there should be a return value
Comment 2 Sharath Dwaral 2013-05-21 10:53:11 EDT
Another scenario

Registering with wrong creds

# subscription-manager register
Username: testuser1
Password: 
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Invalid Credentials
-1
[root@dhcp129-152 entitlement]# echo $1
                                 <<<<< blank
Comment 3 RHEL Product and Program Management 2013-05-21 11:22:22 EDT
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.
Comment 4 Bryan Kearney 2013-05-24 15:10:26 EDT
*** Bug 965666 has been marked as a duplicate of this bug. ***
Comment 5 Bryan Kearney 2013-05-25 08:59:58 EDT
Fixed in 

commit cdc5d128b628fc3fed07d2d3259bf73a5cb90abf
Author: Adrian Likins <alikins@redhat.com>
Date:   Tue May 21 12:09:28 2013 -0400
Comment 6 Sharath Dwaral 2013-06-05 09:47:43 EDT
Version:
# rpm -qa | egrep "subscription-manager|python-rhsm"
subscription-manager-firstboot-1.8.9-1.git.4.bc35701.el5
subscription-manager-migration-data-1.11.3.1-1.git.1.78afd75.el5
python-rhsm-1.8.12-1.git.0.d747a65.el5
subscription-manager-1.8.9-1.git.4.bc35701.el5
subscription-manager-gui-1.8.9-1.git.4.bc35701.el5
subscription-manager-migration-1.8.9-1.git.4.bc35701.el5

# subscription-manager clean
All local data removed

# subscription-manager unregister
System has been unregistered.


Scenario 1:

# subscription-manager identity
This system is not yet registered. Try 'subscription-manager register --help' for more information.
# echo $?
255

Scenario 2:

# subscription-manager unregister
This system is currently not registered.
# echo $?
1

Scenario 3:

# subscription-manager register
Username: test
Password: 
Invalid Credentials
# echo $?
255

Verified
Comment 8 errata-xmlrpc 2013-09-30 19:09:39 EDT
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-2013-1332.html

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