Bug 1225600

Summary: subscription-manager config --remove=rhsm.repo_ca_cert does not exactly restore the default value
Product: Red Hat Enterprise Linux 6 Reporter: John Sefler <jsefler>
Component: python-rhsmAssignee: William Poteat <wpoteat>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.7CC: bkearney, tlavigne, 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: 2015-07-22 06:54:23 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: 1125249    

Description John Sefler 2015-05-27 18:41:00 UTC
Description of problem:
After the solution for bug 1223860 was implemented, the subscription-manager config --remove=SECTION.NAME function no longer eradicates the NAME parameter from the /etc/rhsm/rhsm.conf file.  Instead it restores the default value.  This appears to work for all of the existing parameters except rhsm.repo_ca_cert.

Technically the default value is...

[root@jsefler-os6 ~]# grep repo_ca_cert /etc/rhsm/rhsm.conf
repo_ca_cert=%(ca_cert_dir)sredhat-uep.pem

But after running the set and remove command, the variable is lost...

[root@jsefler-os6 ~]# subscription-manager config --rhsm.repo_ca_cert=/tmp/foobar
[root@jsefler-os6 ~]# grep repo_ca_cert /etc/rhsm/rhsm.conf
repo_ca_cert=/tmp/foobar
[root@jsefler-os6 ~]# subscription-manager config --remove=rhsm.repo_ca_cert
You have removed the value for section rhsm and name repo_ca_cert.
The default value for repo_ca_cert will now be used.
[root@jsefler-os6 ~]# grep repo_ca_cert /etc/rhsm/rhsm.conf
repo_ca_cert=/etc/rhsm/ca/redhat-uep.pem
[root@jsefler-os6 ~]# 

FAILED: expected repo_ca_cert=%(ca_cert_dir)sredhat-uep.pem



Version-Release number of selected component (if applicable):
[root@jsefler-os6 ~]# rpm -q subscription-manager
subscription-manager-1.14.8-1.el6.x86_64


How reproducible:


Steps to Reproduce:
1. above

Actual results:
repo_ca_cert=/etc/rhsm/ca/redhat-uep.pem

Expected results:
repo_ca_cert=%(ca_cert_dir)sredhat-uep.pem

Comment 1 William Poteat 2015-06-02 12:19:05 UTC
master commit 09bf7957ac8bfbd6b6fed20b78aa3a8879a2c953 [python-rhsm]

Comment 3 John Sefler 2015-06-06 12:02:26 UTC
Verifying Version...
[root@jsefler-os6 ~]# rpm -q python-rhsm subscription-manager
python-rhsm-1.14.3-1.el6.x86_64
subscription-manager-1.14.9-1.el6.x86_64

[root@jsefler-os6 ~]# grep repo_ca_cert /etc/rhsm/rhsm.conf
repo_ca_cert=%(ca_cert_dir)sredhat-uep.pem
[root@jsefler-os6 ~]# subscription-manager config --rhsm.repo_ca_cert=/tmp/foobar
[root@jsefler-os6 ~]# grep repo_ca_cert /etc/rhsm/rhsm.conf
repo_ca_cert=/tmp/foobar
[root@jsefler-os6 ~]# subscription-manager config --remove=rhsm.repo_ca_cert
You have removed the value for section rhsm and name repo_ca_cert.
The default value for repo_ca_cert will now be used.
[root@jsefler-os6 ~]# grep repo_ca_cert /etc/rhsm/rhsm.conf
repo_ca_cert=%(ca_cert_dir)sredhat-uep.pem
[root@jsefler-os6 ~]# 

VERIFIED: The original default repo_ca_cert is restored after setting and removing using the config module

Comment 5 John Sefler 2015-06-08 22:08:48 UTC
Additional Note...

Although the default value for rhsm.repo_ca_cert is now restored after setting and removing using the config module, the subscription-manager config --list does not report the repo_ca_cert value in brackets to indicate the Default value is in use.  That is likely due to the python variable substitution for ca_cert_dir.  This seems like a reasonable compromise.


[root@jsefler-os6 ~]# subscription-manager config --list | tail -20
[rhsm]
   baseurl = [https://cdn.redhat.com]
   ca_cert_dir = [/etc/rhsm/ca/]
   consumercertdir = [/etc/pki/consumer]
   entitlementcertdir = [/etc/pki/entitlement]
   full_refresh_on_yum = [0]
   manage_repos = [1]
   pluginconfdir = [/etc/rhsm/pluginconf.d]
   plugindir = [/usr/share/rhsm-plugins]
   productcertdir = [/etc/pki/product]
   repo_ca_cert = /etc/rhsm/ca/redhat-uep.pem   <======= DEFAULT VALUE?
   report_package_profile = [1]

[rhsmcertd]
   autoattachinterval = [1440]
   certcheckinterval = [240]

[] - Default value in use

Comment 6 errata-xmlrpc 2015-07-22 06:54:23 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.

https://rhn.redhat.com/errata/RHBA-2015-1345.html