Skip to content

Commit

Permalink
Merge pull request #9527 from mhashizume/maint/7.x/rhel9-openssh
Browse files Browse the repository at this point in the history
Fix tests on Red Hat 9
  • Loading branch information
cthorn42 authored Nov 26, 2024
2 parents 753d434 + 4b16390 commit 077529e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions acceptance/lib/puppet/acceptance/rpm_util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ module RpmUtils

def rpm_provider(agent)
has_dnf = on(agent, 'which dnf', :acceptable_exit_codes => [0,1]).exit_code
if has_dnf == 0
'dnf'
else
'yum'
end
has_dnf == 0 ? 'dnf' : 'yum'
end

def setup(agent)
@@setup_packages[agent] ||= {}
cmd = rpm_provider(agent)
required_packages = ['createrepo', 'curl', 'rpm-build']
required_packages = %w[createrepo curl rpm-build]
required_packages.each do |pkg|
pkg_installed = (on agent, "#{cmd} list installed #{pkg}", :acceptable_exit_codes => (0..255)).exit_code == 0
# We need a newer OpenSSH for the newer OpenSSL that curl installs
# RE-16677
on(agent, 'dnf upgrade -y openssh') if (agent.platform.start_with?('el-9') && pkg == 'curl')
# package not present, so perform a new install
if !pkg_installed
on agent, "#{cmd} install -y #{pkg}"
Expand Down

0 comments on commit 077529e

Please sign in to comment.