Bug 916353

Summary: Should not persist --serverurl option values to rhsm.conf when calling subscription-manager register with invalid creds
Product: Red Hat Enterprise Linux 7 Reporter: Sharath Dwaral <fsharath>
Component: subscription-managerAssignee: William Poteat <wpoteat>
Status: CLOSED CURRENTRELEASE QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: jgalipea, wpoteat
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: 2014-01-17 16:58:50 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: 863175    

Description Sharath Dwaral 2013-02-27 21:47:27 UTC
Description of problem:

The serverurl entereted during subscription-manager register --serverurl persists in rhsm.conf file even the registration process is incomplete

Version-Release number of selected component (if applicable):

# rpm -qa | egrep "subscription-manager|python-rhsm"
python-rhsm-1.8.3-1.el7.x86_64
subscription-manager-gui-1.8.3-1.el7.x86_64
subscription-manager-migration-1.8.3-1.el7.x86_64
subscription-manager-debuginfo-1.8.3-1.el7.x86_64
subscription-manager-1.8.3-1.el7.x86_64
subscription-manager-firstboot-1.8.3-1.el7.x86_64
python-rhsm-debuginfo-1.8.3-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:

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

# cat /etc/rhsm/rhsm.conf | grep hostname
# Server hostname:
hostname = subscription.rhn.redhat.com
proxy_hostname =

# subscription-manager register --serverurl fsharath-candlepin.usersys.redhat.com:8443/candlepin
Username: testuser1
Password: 
Organization: sn     
Organization sn does not exist.

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

Actual results:

# cat /etc/rhsm/rhsm.conf | grep hostname
# Server hostname:
hostname=fsharath-candlepin.usersys.redhat.com
proxy_hostname =

Expected results:

hostname should not get updated when the registration process is incomplete.

Additional info: