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 736784 - subscription-manager config --remove adds config property to rhsm.conf if it doesn't exist
Summary: subscription-manager config --remove adds config property to rhsm.conf if it ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: William Poteat
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel62 743047
TreeView+ depends on / blocked
 
Reported: 2011-09-08 17:05 UTC by Michael Stead
Modified: 2011-12-06 17:24 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 17:24:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1695 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2011-12-06 01:23:29 UTC

Description Michael Stead 2011-09-08 17:05:28 UTC
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 20:40:39 UTC
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 12:45:32 UTC
Actually, it should not add the entry on remove.

Added additional checking to stop this from happening.

Comment 5 John Sefler 2011-09-09 15:18:22 UTC
# 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 19:16:31 UTC
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-25 00:32:44 UTC
[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 12:39:52 UTC
Written with sys.stderr.write for ConfigCommand errors.

Commit 600f2813db4471955e9f1efdfe4a5a1d270f7133

Comment 10 J.C. Molet 2011-09-26 15:51:41 UTC
[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 17:24:09 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.

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.