summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaomi Reeves <naomi.c.reeves@gmail.com>2017-09-22 12:04:08 -0700
committerNaomi Reeves <naomi.c.reeves@gmail.com>2017-09-29 00:08:28 -0700
commit414858767b52d47065312c68adcc2a60fa517fa4 (patch)
tree793c70e1d4e9cac26ebce0a46f2e27d184b00860
parent7dbd6df0ba4060efe1a6086c990d77619d7a0d4f (diff)
downloadchef-414858767b52d47065312c68adcc2a60fa517fa4.tar.gz
dnf_resource: be more specific for rhel packages
With #6351 and #6377, the DNF package provider was fixed to use yum by default on RHEL 7, but the resource was still calling the DNF provider if it happened to be installed. We want to use the default of yum for RHEL 7, and only use DNF if we call `set_priority_map` directly. Signed-off-by: Naomi Reeves <naomi.c.reeves@gmail.com> Resolves: Unexpectedly switching package managers
-rw-r--r--lib/chef/resource/dnf_package.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/resource/dnf_package.rb b/lib/chef/resource/dnf_package.rb
index d92dc12ec7..5713852d6f 100644
--- a/lib/chef/resource/dnf_package.rb
+++ b/lib/chef/resource/dnf_package.rb
@@ -29,10 +29,12 @@ class Chef
allowed_actions :install, :upgrade, :remove, :purge, :reconfig, :lock, :unlock, :flush_cache
- provides :package, platform_family: %w{rhel fedora amazon} do
+ provides :package, platform_family: %w{fedora amazon} do
which("dnf") && shell_out("rpm -q dnf").stdout =~ /^dnf-[1-9]/
end
+ provides :package, platform_family: %{rhel}, platform_version: ">= 8"
+
provides :dnf_package
# Install a specific arch