Hide Forgot
Description of problem: When using the "config --remove section.property" option of subscription manager, if the specified property is NOT a default property, and is not in the config file, it will be added. Version-Release number of selected component (if applicable): subscription-manager-firstboot-0.96.9-1.git.4.3236ce3.el6.x86_64 subscription-manager-gnome-0.96.9-1.git.4.3236ce3.el6.x86_64 subscription-manager-0.96.9-1.git.4.3236ce3.el6.x86_64 subscription-manager-debuginfo-0.96.9-1.git.4.3236ce3.el6.x86_64 How reproducible: always Steps to Reproduce: [root@mstead mstead]# cat /etc/rhsm/rhsm.conf | grep unknown_prop [root@mstead mstead]# [root@mstead mstead]# sudo subscription-manager config --remove rhsmcertd.unknown_prop You have removed the value for section rhsmcertd and name unknown_prop. [root@mstead mstead]# [root@mstead mstead]# cat /etc/rhsm/rhsm.conf | grep unknown_prop unknown_prop = [root@mstead mstead]# Actual results: Received message "You have removed the value for section rhsmcertd and name unknown_prop." and the property was added to the config file with an empty value. Expected results: Receive a message stating that it could not be removed. Additional info:
Having discussed this with wpoteat earlier this week, I've learned that this behavior is a feature! - albeit a harmless feature - a feature of the python library being used to read/set parameters. Nevertheless a valid bug. setting Severity to "low"...
Actually, it should not add the entry on remove. Added additional checking to stop this from happening.
# rpm -q subscription-manager subscription-manager-0.96.9-1.git.8.4e7d06b.el6.x86_64 # rpm -q python-rhsm python-rhsm-0.96.11-1.git.7.4aaef6e.el6.noarch # subscription-manager config --remove rhsmcertd.unknown-prop exit expected at most 1 arguments, got 2 moving back to NEW/FailedQA... I suspect a needed commit for python-rhsm has not happened yet. Including a commit hash (in comment 3) is always helpful when moving a bug to MODIFIED.
Now working as expected: [root@jmolet-vm0 ~]# cat /etc/rhsm/rhsm.conf | grep unknown_prop [root@jmolet-vm0 ~]# subscription-manager config --remove rhsmcertd.unknown_prop Error: Section rhsmcertd and name unknown_prop does not exist. [root@jmolet-vm0 ~]# cat /etc/rhsm/rhsm.conf | grep unknown_prop python-rhsm-0.96.12-1.git.0.4862863.el6.noarch subscription-manager-firstboot-0.96.11-1.git.1.945da16.el6.x86_64 subscription-manager-0.96.11-1.git.1.945da16.el6.x86_64 subscription-manager-gnome-0.96.11-1.git.1.945da16.el6.x86_64 Marking VERIFIED.
[root@jsefler-onprem-62server ~]# subscription-manager config --remove rhsmcertd.unknown_prop 1>/tmp/stdout 2>/tmp/stderr [root@jsefler-onprem-62server ~]# echo $? 255 [root@jsefler-onprem-62server ~]# cat /tmp/stderr [root@jsefler-onprem-62server ~]# cat /tmp/stdout Error: Section rhsmcertd and name unknown_prop does not exist. [root@jsefler-onprem-62server ~]# moving back to ASSIGNED... THE ERROR MESSAGE SHOULD BE WRITTEN TO STDERR NOT STDOUT.
Written with sys.stderr.write for ConfigCommand errors. Commit 600f2813db4471955e9f1efdfe4a5a1d270f7133
[root@jmolet-vm0 ~]# subscription-manager config --remove rhsmcertd.unknown_prop 1> /tmp/stdout 2> /tmp/stderr [root@jmolet-vm0 ~]# echo $? 255 [root@jmolet-vm0 ~]# cat /tmp/stderr Error: Section rhsmcertd and name unknown_prop does not exist. [root@jmolet-vm0 ~]# cat /tmp/stdout [root@jmolet-vm0 ~]# errors are going to /tmp/stderr as they should now. Tested against: subscription-manager-0.96.11-1.git.9.b453a83.el6.x86_64
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-2011-1695.html