Bug 1415700

Summary: ovirt-release leaves repo files behind after removal
Product: [oVirt] ovirt-release Reporter: Evgheni Dereveanchin <ederevea>
Component: GeneralAssignee: Yuval Turgeman <yturgema>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 4.0.1CC: bugs, sbonazzo, ylavi
Target Milestone: ovirt-4.3.0Flags: rule-engine: ovirt-4.3+
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-25 07:32:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Evgheni Dereveanchin 2017-01-23 13:17:05 UTC
Description of problem:
According to documentation, old release RPMs should be removed after upgrade, however config files are left behind causing duplicate repo definitions.

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

How reproducible:

Steps to Reproduce:

1. Check release versions installed
 # rpm -qa | grep ovirt-release

2. check that file belongs to the release RPM
 # rpm -qf /etc/yum.repos.d/ovirt-3.6.repo 

3. remove release RPM
 yum remove ovirt-release36

Actual results:
repo files still in place
 # rpm -qf /etc/yum.repos.d/ovirt-3.6.repo 
 file /etc/yum.repos.d/ovirt-3.6.repo is not owned by any package

Expected results:
repo files removed together with RPM
 # rpm -qf /etc/yum.repos.d/ovirt-3.6.repo 
 error: file /etc/yum.repos.d/ovirt-3.9.repo: No such file or directory

Additional info:
Same happens to 4.0 release file, easy to test on a CentOS box:

1) # yum install http://resources.ovirt.org/pub/yum-repo/ovirt-release40.rpm
2) # rpm -qf /etc/yum.repos.d/ovirt-4.0.repo 
3) # yum remove ovirt-release40
4) # rpm -qf /etc/yum.repos.d/ovirt-4.0.repo 
file /etc/yum.repos.d/ovirt-4.0.repo is not owned by any package

Comment 1 Yuval Turgeman 2017-07-16 11:00:10 UTC
We use both %ghost and %config(noreplace), this can't be achieved with both directives, we need to select one.

Using ghost only, would mean having the exact repo files that we need (no 0 size repo files) that would be removed with 'rpm -e'.

Using noreplace by itself, would mean having some empty repo files, rpm -V fails on the files that were changed, and rpm -e saves the files with '.rpmsave'.

The standard for yum repo files is config(noreplace), but is it the best solution in this case also ?

Comment 2 Sandro Bonazzola 2017-09-04 13:10:14 UTC
I'm not sure config(noreplace) is the best one here. Looks like ghost is fitting better for the required use case.

Comment 3 Yaniv Lavi 2018-06-25 07:32:35 UTC
Closing old bugs.
Please reopen if still relevant.
Patches are welcomed.