Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1371585 - Removing katello-ca-consumer rpm should revert rhsm.conf
Removing katello-ca-consumer rpm should revert rhsm.conf
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: katello-agent (Show other bugs)
6.2.0
Unspecified Unspecified
medium Severity medium (vote)
: GA
: Unused
Assigned To: satellite6-bugs
Nikhil Kathole
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-30 10:36 EDT by Sean O'Keeffe
Modified: 2018-08-17 12:51 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
When removing katello-ca-consumer RPM, the backup of /etc/rhsm/rhsm.conf was not restored. This is now fixed.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-02-21 07:57:01 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 16388 None None None 2016-08-31 03:38 EDT
Red Hat Product Errata RHBA-2018:0338 normal SHIPPED_LIVE Red Hat Satellite 6.3 Tools 2018-02-21 14:30:02 EST

  None (edit)
Description Sean O'Keeffe 2016-08-30 10:36:13 EDT
Description of problem:
if you install the katello-ca-consumer rpm and them remove it /etc/rhsm/rhsm.conf, doesnt revert back. 
During install there is a backup created /etc/rhsm/rhsm.conf-kat-backup, we should copy this file to /etc/rhsm/rhsm.conf on removal.


Version-Release number of selected component (if applicable):
6.X

How reproducible:
100%

Steps to Reproduce:
1. ms5sum /etc/rhsm/rhsm.conf 
2. rpm -Uvh http://<SATELLITE6>/pub/katello-ca-consumer-latest.noarch.rpm
3. rpm -e katello-ca-consumer
4. ms5sum /etc/rhsm/rhsm.conf

md5sum's should match. 

Actual results:
the rhsm.conf pointing to Satellite is left after removing it

Expected results:
rhsm.conf should be restored from rhsm.conf-kat-backup

Additional info:
Comment 2 Bryan Kearney 2016-09-07 16:18:33 EDT
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16388 has been resolved.
Comment 5 Evgeni Golov 2017-08-23 05:04:37 EDT
I am not QA contact, so I am not going to officially mark this as VERIFIED, but it works as advertised in my setup (6.3.0 Snap 12):

Make a copy of the old rhsm.conf:
# cp /etc/rhsm/rhsm.conf ./rhsm.conf.orig

Install katello-ca-consumer:
# yum localinstall http://192.168.121.147/pub/katello-ca-consumer-latest.noarch.rpm

Make a copy of the modified rhsm.conf:
# cp /etc/rhsm/rhsm.conf ./rhsm.conf.katello

Remove katello-ca-consumer:
# yum erase katello-ca-consumer\*

Make a copy of the restored rhsm.conf
# cp /etc/rhsm/rhsm.conf ./rhsm.conf.new

Verify that only the modified version has a different checksum:
# md5sum rhsm.conf.*
ea0b3593f3d504b16a266d58b0f83c85  rhsm.conf.katello
625497ba8aaa66608a79c4eefd81ff09  rhsm.conf.new
625497ba8aaa66608a79c4eefd81ff09  rhsm.conf.orig
Comment 6 Nikhil Kathole 2017-12-21 04:54:24 EST
VERIFIED

Version Tested:
Satellite-6.3 Snap 29

steps:
# md5sum /etc/rhsm/rhsm.conf
f8f5f059d09476660fab36d8b0d65367  /etc/rhsm/rhsm.conf

# rpm -Uvh http://satellite/pub/katello-ca-consumer-latest.noarch.rpm
Retrieving http://satellite/pub/katello-ca-consumer-latest.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:katello-ca-consumer-sat.################################# [100%]

# md5sum /etc/rhsm/rhsm.conf
f8b0bc5db94930e869535d146b9d2b15  /etc/rhsm/rhsm.conf

# yum erase katello-ca-consume\*
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package katello-ca-consumer-satellite.noarch 0:1.0-1 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================
 Package                                                                 Arch                  Version              Repository                Size
===================================================================================================================================================
Removing:
 katello-ca-consumer-satellite                noarch                1.0-1                installed                 15 k

Transaction Summary
===================================================================================================================================================
Remove  1 Package

Installed size: 15 k
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Erasing    : katello-ca-consumer-satellite-1.0-1.noarch                                                           1/1
  Verifying  : katello-ca-consumer-satellite-1.0-1.noarch                                                           1/1

Removed:
  katello-ca-consumer-satellite.noarch 0:1.0-1

Complete!

# md5sum /etc/rhsm/rhsm.conf
f8f5f059d09476660fab36d8b0d65367  /etc/rhsm/rhsm.conf
Comment 9 errata-xmlrpc 2018-02-21 07:57:01 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.

https://access.redhat.com/errata/RHBA-2018:0338

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