Skip to content

Commit 822a2e2

Browse files
author
Christoph Maser
committed
fix package name for yum plugin versionlock on RHEL/CentOS 8
fixes voxpupuli#197
1 parent ee282d8 commit 822a2e2

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

Diff for: manifests/plugin/versionlock.pp

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@
1818
String $path = '/etc/yum/pluginconf.d/versionlock.list',
1919
Boolean $clean = false,
2020
) {
21+
$pkg_prefix = $facts['os']['release']['major'] ? {
22+
Variant[Integer[5,5], Enum['5']] => 'yum',
23+
'8' => 'python3-dnf-plugin',
24+
default => 'yum-plugin',
25+
}
2126
yum::plugin { 'versionlock':
22-
ensure => $ensure,
27+
ensure => $ensure,
28+
pkg_prefix => $pkg_prefix,
2329
}
2430

2531
include yum::clean

Diff for: spec/acceptance/define_versionlock_spec.rb

+12-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
end
4444
describe file('/etc/yum/pluginconf.d/versionlock.list') do
4545
it { is_expected.to be_file }
46-
if %w[6 7].include?(fact('os.release.major'))
46+
if %w[7].include?(fact('os.release.major'))
4747
it { is_expected.to contain '0:bash-4.1.2-9.el6_2.*' }
4848
it { is_expected.to contain '0:tcsh-3.1.2-9.el6_2.*' }
4949
it { is_expected.to contain '2:netscape-8.1.2-9.el6_2.*' }
@@ -53,6 +53,15 @@
5353
it { is_expected.to contain 'netscape-2:8.1.2-9.el6_2.*' }
5454
end
5555
end
56+
if fact('os.release.major') == '8'
57+
describe package('python3-dnf-plugin-versionlock') do
58+
it { is_expected.to be_installed }
59+
end
60+
else
61+
describe package('yum-plugin-versionlock') do
62+
it { is_expected.to be_installed }
63+
end
64+
end
5665
end
5766
it 'must work if clean is specified' do
5867
shell('yum repolist', acceptable_exit_codes: [0])
@@ -76,10 +85,11 @@
7685
# Run it twice and test for idempotency
7786
apply_manifest(pp, catch_failures: true)
7887
apply_manifest(pp, catch_changes: true)
88+
7989
# Check the cache is really empty.
8090
# all repos will have 0 packages.
8191
# bit confused by the motivation of the first test?
82-
if %w[6 7].include?(fact('os.release.major'))
92+
if fact('os.release.major') == '7'
8393
shell('yum -C repolist -d0 | grep -v "repo id" | awk "{print $NF}" FS= | grep -v 0', acceptable_exit_codes: [1])
8494
shell('yum -q list available samba-devel', acceptable_exit_codes: [1])
8595
else

0 commit comments

Comments
 (0)