From 8a7b60a9e3e99ad541139314b99bab731e65a155 Mon Sep 17 00:00:00 2001 From: Michael Hashizume Date: Mon, 25 Nov 2024 10:49:24 -0800 Subject: [PATCH 1/2] Ruby style updates This commit updates the RPM util test to use a ternary operator instead of a longer if...else statement and to use a string-array literal for brevity. (cherry picked from commit d8a2f8661ea08d752afe54b4d77b0b4ef9775a34) --- acceptance/lib/puppet/acceptance/rpm_util.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/acceptance/lib/puppet/acceptance/rpm_util.rb b/acceptance/lib/puppet/acceptance/rpm_util.rb index eae1f49186c..a97ba22aca3 100644 --- a/acceptance/lib/puppet/acceptance/rpm_util.rb +++ b/acceptance/lib/puppet/acceptance/rpm_util.rb @@ -7,17 +7,13 @@ 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 # package not present, so perform a new install From 4b16390d4875e5e39275e5acd1a56bf46102b6fc Mon Sep 17 00:00:00 2001 From: Michael Hashizume Date: Mon, 25 Nov 2024 10:47:55 -0800 Subject: [PATCH 2/2] Update OpenSSH on Red Hat 9 We are encountering an issue with the older version of OpenSSH installed on the Red Hat 9 images that we use in CI. This commit adds a temporary step to update OpenSSH on Red Hat Enterprise Linux 9 platforms. (cherry picked from commit 7f54e442ff1edb325a25b807e898c0939f425918) --- acceptance/lib/puppet/acceptance/rpm_util.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/acceptance/lib/puppet/acceptance/rpm_util.rb b/acceptance/lib/puppet/acceptance/rpm_util.rb index a97ba22aca3..d34e63555b8 100644 --- a/acceptance/lib/puppet/acceptance/rpm_util.rb +++ b/acceptance/lib/puppet/acceptance/rpm_util.rb @@ -16,6 +16,9 @@ def setup(agent) 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}"