RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1225600 - subscription-manager config --remove=rhsm.repo_ca_cert does not exactly restore the default value
Summary: subscription-manager config --remove=rhsm.repo_ca_cert does not exactly rest...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python-rhsm
Version: 6.7
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: William Poteat
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel67
TreeView+ depends on / blocked
 
Reported: 2015-05-27 18:41 UTC by John Sefler
Modified: 2015-07-22 06:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-22 06:54:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1345 0 normal SHIPPED_LIVE subscription-manager and python-rhsm bug fix and enhancement update 2015-07-20 17:59:53 UTC

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


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