summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-01-15 19:52:27 -0800
committerTim Smith <tsmith@chef.io>2018-01-15 19:52:27 -0800
commit3980045b2b269eba6a7ee66fe9b20f28b4b85b3d (patch)
treecdfca7607b241f6a25545d795990d5daaf781a0d
parent3a5d4372f5d81078cf1631fafb6ca252e42c1d27 (diff)
downloadchef-dnf_yum_repo.tar.gz
Add the same logic to other actionsdnf_yum_repo
Missed that entirely Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/provider/yum_repository.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/chef/provider/yum_repository.rb b/lib/chef/provider/yum_repository.rb
index a97bd94e95..20a7a8e3d2 100644
--- a/lib/chef/provider/yum_repository.rb
+++ b/lib/chef/provider/yum_repository.rb
@@ -88,7 +88,12 @@ class Chef
end
declare_resource(:ruby_block, "package-cache-reload-#{new_resource.repositoryid}") do
- block { Chef::Provider::Package::Yum::YumCache.instance.reload }
+ if ( platform?("fedora") && node["platform_version"].to_i >= 22 ) ||
+ ( platform_family?("rhel") && node["platform_version"].to_i >= 8 )
+ block { Chef::Provider::Package::Dnf::PythonHelper.instance.restart }
+ else
+ block { Chef::Provider::Package::Yum::YumCache.instance.reload }
+ end
action :nothing
end
end
@@ -101,7 +106,12 @@ class Chef
end
declare_resource(:ruby_block, "package-cache-reload-#{new_resource.repositoryid}") do
- block { Chef::Provider::Package::Yum::YumCache.instance.reload }
+ if ( platform?("fedora") && node["platform_version"].to_i >= 22 ) ||
+ ( platform_family?("rhel") && node["platform_version"].to_i >= 8 )
+ block { Chef::Provider::Package::Dnf::PythonHelper.instance.restart }
+ else
+ block { Chef::Provider::Package::Yum::YumCache.instance.reload }
+ end
action :run
end
end