summaryrefslogtreecommitdiff
path: root/lib/chef/provider/package
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-02-07 17:45:19 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2017-02-08 05:51:26 -0800
commit23ffb3d64f016476da8861201fb7e5177df6a7d5 (patch)
tree151aaef86fcb227d9f4aa0090873b1feb83df63f /lib/chef/provider/package
parent05b5f4ae2b27bfd759c960ad1378a61e9895b606 (diff)
downloadchef-23ffb3d64f016476da8861201fb7e5177df6a7d5.tar.gz
do not support dnf_package on dnf 0.xlcg/ban-dnf-0.6
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/provider/package')
-rw-r--r--lib/chef/provider/package/dnf.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/provider/package/dnf.rb b/lib/chef/provider/package/dnf.rb
index bf6aa2438f..6eb495df30 100644
--- a/lib/chef/provider/package/dnf.rb
+++ b/lib/chef/provider/package/dnf.rb
@@ -1,5 +1,5 @@
#
-# Copyright:: Copyright 2016, Chef Software, Inc.
+# Copyright:: Copyright 2016-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,6 +18,7 @@
require "chef/provider/package"
require "chef/resource/dnf_package"
require "chef/mixin/which"
+require "chef/mixin/shell_out"
require "chef/mixin/get_source_from_package"
require "chef/provider/package/dnf/python_helper"
require "chef/provider/package/dnf/version"
@@ -27,6 +28,7 @@ class Chef
class Package
class Dnf < Chef::Provider::Package
extend Chef::Mixin::Which
+ extend Chef::Mixin::ShellOut
include Chef::Mixin::GetSourceFromPackage
allow_nils
@@ -34,7 +36,7 @@ class Chef
use_package_name_for_source
provides :package, platform_family: %w{rhel fedora} do
- which("dnf")
+ which("dnf") && shell_out("rpm -q dnf").stdout =~ /^dnf-[1-9]/
end
provides :dnf_package, os: "linux"