Bug 1223860
Summary: | subscription-manager config --rhsmcertd.autoattachinterval adds configuration with incorrect case. | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Dylan Gross <dgross> |
Component: | subscription-manager | Assignee: | William Poteat <wpoteat> |
Status: | CLOSED ERRATA | QA Contact: | John Sefler <jsefler> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.6 | CC: | bkearney, dgoodwin, tlavigne, wpoteat |
Target Milestone: | rc | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
When configuration options in camelCase are removed from the /etc/rhsm/rhsm.conf file and then restored with the "subscription-manager config" command, they are restored in lowercase. For example, the "subscription-manager config --rhsmcertd.autoattachinterval" command fails to restore the "autoAttachInterval" option in camelCase and, as a consequence, the entry is ignored by the rhsmcertd daemon. However, an existing value can be successfully changed by using such a command. With this update, the "subscription-manager config --remove" command no longer deletes the option from the configuration file but restores its default value instead. As a result, the described problem occurs only when configuration options are manually deleted from /etc/rhsm/rhsm.conf and not reset with the "--remove" option, which is recommended.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2015-07-22 06:54:15 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: |
Description
Dylan Gross
2015-05-21 14:46:02 UTC
One more note: if the /etc/rhsm/rhsm.conf file already contains the correct formatted argument, the config command will update it appropriately. # grep -i autoAttachInterval /etc/rhsm/rhsm.conf autoAttachInterval = 1440 # subscription-manager config --rhsmcertd.autoattachinterval=2 # grep -i autoAttachInterval /etc/rhsm/rhsm.conf autoAttachInterval = 2 This behaviour is also present on RHEL 7.1 with subscription-manager-1.13.22-1.el7 RHEL 5.11 with subscription-manager-1.11.3-14.el5_11 # subscription-manager config --help | grep -i autoattach --rhsmcertd.autoattachinterval=RHSMCERTD.AUTOATTACHINTERVAL Section: rhsmcertd, Name: autoattachinterval And attempts to specify it with a different case fail because it is unrecognized.... # subscription-manager config --rhsmcertd.autoAttachInterval=2 Usage: subscription-manager config [OPTIONS] subscription-manager: error: no such option: --rhsmcertd.autoAttachInterval As shown, the casing for the config flag is all lower. You did not use that. The rhsm.conf file is in camel case, but the config tool help shows the casing to use here. Re: Comment #4 I apologize if my initial comment was confusing or unclear. The example of the CLI attempt using CamelCase was mostly just an example to illustrate that it was not a problem with the "subscription-manager config --help" documentation. The problem is just with the resulting config when the valid case is used on the CLI, but it puts the incorrect case in the config file. Please disregard Comment 1 The issue in general is that the config --remove command takes the entry out of the config file. The entry cannot be replaced in the original casing because the .ini parser will only deal in lowercase. If the entry has been previously removed, it must be manually inserted into the file. Going forward with the code change associated, the entry will not be removed when the --remove command is called. The entry will be set to the default in the file. Before verifying, I just want to make it clear that using the "subscription-manager config --remove=SECTION.NAME" function was causing trouble when trying to restore the configuration for the camelCased config parameters... productCertDir entitlementCertDir consumerCertDir pluginDir pluginConfDir certCheckInterval autoAttachInterval As stated in comment 6, the problem was that once the camelCased configurations are removed and then restored, they are restored in lowercase which caused problems because the C-based rhsmcertd tools are looking for the camelCase configurations. If not found, then a default value is used. The patch that Will implemented in comment 6 was to write the default configurations to /etc/rhsm/rhsm.conf rather than an absolute delete when the remove option is specified. Beware that if you manually edit /etc/rhsm/rhsm.conf to remove a camelCased configuration, you will resurrect the situation reported in comment 1. Therefore, do not manually remove configurations from /etc/rhsm/rhsm.conf. Only use the "subscription-manager config --remove=SECTION.NAME" function. Verifying Version.... [root@jsefler-os6 RHEL-6]# rpm -q subscription-manager subscription-manager-1.14.8-1.el6.x86_64 STARTING CONFIG [root@jsefler-os6 RHEL-6]# subscription-manager config | grep -B1 -i autoAttachInterval [rhsmcertd] autoattachinterval = [1440] [root@jsefler-os6 RHEL-6]# grep autoAttachInterval /etc/rhsm/rhsm.conf autoAttachInterval = 1440 SETTING A DIFFERENT CONFIG [root@jsefler-os6 RHEL-6]# subscription-manager config --rhsmcertd.autoattachinterval=100 [root@jsefler-os6 RHEL-6]# subscription-manager config | grep -B1 -i autoAttachInterval [rhsmcertd] autoattachinterval = 100 [root@jsefler-os6 RHEL-6]# grep autoAttachInterval /etc/rhsm/rhsm.conf autoAttachInterval = 100 REMOVING THE CONFIG (RESTORES THE DEFAULT) [root@jsefler-os6 RHEL-6]# subscription-manager config --remove=rhsmcertd.autoattachinterval You have removed the value for section rhsmcertd and name autoattachinterval. The default value for autoattachinterval will now be used. [root@jsefler-os6 RHEL-6]# subscription-manager config | grep -B1 -i autoAttachInterval [rhsmcertd] autoattachinterval = [1440] [root@jsefler-os6 RHEL-6]# grep autoAttachInterval /etc/rhsm/rhsm.conf autoAttachInterval = 1440 Remember, DO NOT MANUALLY EDIT /etc/rhsm/rhsm.conf to remove parameters. 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 |