summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/provider/package/dnf/python_helper.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/provider/package/dnf/python_helper.rb b/lib/chef/provider/package/dnf/python_helper.rb
index b3593f6efd..56706764d0 100644
--- a/lib/chef/provider/package/dnf/python_helper.rb
+++ b/lib/chef/provider/package/dnf/python_helper.rb
@@ -37,7 +37,8 @@ class Chef
DNF_HELPER = ::File.expand_path(::File.join(::File.dirname(__FILE__), "dnf_helper.py")).freeze
def dnf_command
- @dnf_command ||= which("python", "python3", "python2", "python2.7") do |f|
+ # platform-python is used for system tools on RHEL 8 and is installed under /usr/libexec
+ @dnf_command ||= which("platform-python", "python", "python3", "python2", "python2.7", extra_path: "/usr/libexec") do |f|
shell_out("#{f} -c 'import dnf'").exitstatus == 0
end + " #{DNF_HELPER}"
end