Bug 843191

Summary: subscription-manager version value for server type fails to read "Unknown"
Product: Red Hat Enterprise Linux 5 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Adrian Likins <alikins>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.9CC: alikins, awood, bkearney, skallesh
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-08 03:57:55 UTC Type: Bug
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: 771748    

Description John Sefler 2012-07-25 20:25:10 UTC
Description of problem:
When we are not registered (to rhsm or classic) and the server.hostname is inaccessible, the remote entitlement server type reported should be "Unknown".

Version-Release number of selected component (if applicable):
[root@jsefler-rhel59 ~]# rpm -q subscription-manager
subscription-manager-1.0.9-1.git.37.53fde9a.el5


How reproducible:


Steps to Reproduce:
[root@jsefler-rhel59 ~]# subscription-manager unregister
System has been un-registered.
[root@jsefler-rhel59 ~]# subscription-manager config --server.hostname=FOO
[root@jsefler-rhel59 ~]# subscription-manager version
remote entitlement server: Unknown
remote entitlement server type: subscription management service
subscription-manager: 1.0.9-1.git.37.53fde9a.el5
python-rhsm: 1.0.3-1.git.2.47dc8f4.el5
[root@jsefler-rhel59 ~]# 

  
Actual results:
remote entitlement server type: subscription management service

Expected results:
remote entitlement server type: Unknown

Additional info:

Comment 1 RHEL Program Management 2012-07-25 20:38:21 UTC
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 2 Adrian Likins 2012-08-02 15:22:14 UTC
Should be fixed in:

commit 986fa2f5c8df69142ac3fd4ad0e05e5e536006ef
Author: Adrian Likins <alikins>
Date:   Thu Aug 2 11:11:40 2012 -0400

    843191: 'version' command showed wrong info with no network
    
    If the attempt to get the status and version info from the
    candlepin server failed (for example, wrong host name or
    missing certs) the server type defaulted to
    'subscription management service' which is not particular
    correct.
    
    Errors were also being ignored, so at least show the
    error and log it now. server-type should be "Unknown"
    in these cases now.

(patch out for review at https://github.com/candlepin/subscription-manager/pull/178)

Comment 4 Shwetha Kallesh 2012-08-14 11:14:28 UTC
Moving bug back to new..Verification failed

RPM version:
[root@dhcp201-115 ~]# rpm -qa | grep subscription-manager
subscription-manager-migration-1.0.13-1.git.20.5346dac.el5
subscription-manager-1.0.13-1.git.20.5346dac.el5
subscription-manager-gui-1.0.13-1.git.20.5346dac.el5
subscription-manager-migration-data-1.11.2.3-1.git.0.861f9ba.el5
subscription-manager-firstboot-1.0.13-1.git.20.5346dac.el5


[root@dhcp201-115 ~]# subscription-manager config --server.hostname=FOO
[root@dhcp201-115 ~]# subscription-manager version
Error while checking server version: (-2, 'Name or service not known')
remote entitlement server: Unknown
remote entitlement server type: subscription management service
subscription-manager: 1.0.13-1.git.20.5346dac.el5
python-rhsm: 1.0.5-1.git.1.1ce0910.el5

Comment 5 Adrian Likins 2012-08-17 19:02:06 UTC
commit 4eaa9efbf9317a5391e80d323ec16ab90ef0dbc8
Author: Adrian Likins <alikins>
Date:   Thu Aug 16 10:00:33 2012 -0400

    843191: handle network errors better for 'version' command
    
    Refactor utils.get_*_versions and add more exception
    handling. Add test cases, and add mocking for
    rhn classic check to test cases.

should be 1.0.14-1

Comment 6 Shwetha Kallesh 2012-09-18 07:05:10 UTC
Verified!!

[root@dhcp201-110 pki]# rpm -qa | grep subscription-manager
subscription-manager-1.0.17-1.el5
subscription-manager-gui-1.0.17-1.el5
subscription-manager-firstboot-1.0.17-1.el5


[root@dhcp201-110 pki]# subscription-manager unregister
System has been un-registered.
[root@dhcp201-110 pki]# subscription-manager config --server.hostname=FOO
[root@dhcp201-110 pki]# subscription-manager version
registered to: Unknown
server type: Unknown
subscription-manager: 1.0.17-1.el5
python-rhsm: 1.0.6-1.el5

Comment 8 errata-xmlrpc 2013-01-08 03:57:55 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-2013-0033.html