Bug 1704984

Summary: Upgrading katello-ca-consumer package revert rhsm.conf to point to CDN/RHN
Product: Red Hat Satellite Reporter: achadha
Component: RegistrationAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Stephen Wadeley <swadeley>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.4CC: cyrill.naef, pdwyer, rbobek, sraut
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-07 08:49:52 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:
Attachments:
Description Flags
fixed spec file none

Description achadha 2019-05-01 00:09:57 UTC
Description of problem:
While upgrading katello-ca-consumer package on the client system register to satellite, it reverts rhsm.conf to point to CDN/RHN

Version-Release number of selected component (if applicable):
katello-ca-consumer package


How reproducible:


Steps to Reproduce:
1. Create a new version of katello-ca-consumer package on satellite
2. Upgrade the same on the client, for example
# rpm -Uvh http://ssatellite.example.com/pub/katello-ca-consumer-latest.noarch.rpm
3. Now check hostname entry in /etc/rhsm/rhsm.conf or output of command "subscription-manager config"

Actual results:
It points to CDN/RHN


Expected results:
It should point to satellite


Additional info:

Comment 4 Cyrill Näf 2019-05-15 09:38:46 UTC
In the post uninstall section is no differentiation between upgrade and removal.

According to the RPM build docs from fedora (https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#Syntax) it should look like the following lines:


...
%postun
if [ $1 -eq 0 ]
then
        test -f /etc/rhsm/rhsm.conf.kat-backup && command cp /etc/rhsm/rhsm.conf.kat-backup /etc/rhsm/rhsm.conf
fi
...

instead of

...
%postun
test -f /etc/rhsm/rhsm.conf.kat-backup && command cp /etc/rhsm/rhsm.conf.kat-backup /etc/rhsm/rhsm.conf
...



With that in place, it will restore the default configuration if the package gets uninstalled. If the package gets upgraded it won't do anything which is the expected behavior.

Comment 5 Cyrill Näf 2019-05-15 09:40:23 UTC
Created attachment 1568918 [details]
fixed spec file

Comment 8 Roman Bobek 2019-11-07 08:49:52 UTC
Hi all, this is a duplicate of BZ #1619533. Please attach your cases to the other one to increase visibility. I'm closing this one.
-Roman

*** This bug has been marked as a duplicate of bug 1619533 ***