Bug 736784 - subscription-manager config --remove adds config property to rhsm.conf if it doesn't exist
subscription-manager config --remove adds config property to rhsm.conf if it ...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
6.2
Unspecified Unspecified
unspecified Severity low
: rc
: ---
Assigned To: William Poteat
John Sefler
:
Depends On:
Blocks: rhsm-rhel62 743047
  Show dependency treegraph
 
Reported: 2011-09-08 13:05 EDT by Michael Stead
Modified: 2011-12-06 12:24 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-06 12:24:09 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Stead 2011-09-08 13:05:28 EDT
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:
Comment 2 John Sefler 2011-09-08 16:40:39 EDT
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"...
Comment 3 William Poteat 2011-09-09 08:45:32 EDT
Actually, it should not add the entry on remove.

Added additional checking to stop this from happening.
Comment 5 John Sefler 2011-09-09 11:18:22 EDT
# 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.
Comment 7 J.C. Molet 2011-09-22 15:16:31 EDT
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.
Comment 8 John Sefler 2011-09-24 20:32:44 EDT
[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.
Comment 9 William Poteat 2011-09-26 08:39:52 EDT
Written with sys.stderr.write for ConfigCommand errors.

Commit 600f2813db4471955e9f1efdfe4a5a1d270f7133
Comment 10 J.C. Molet 2011-09-26 11:51:41 EDT
[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
Comment 11 errata-xmlrpc 2011-12-06 12:24:09 EST
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

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