diff options
author | Thom May <thom@chef.io> | 2016-08-10 10:58:28 +0100 |
---|---|---|
committer | Thom May <thom@chef.io> | 2016-08-24 10:17:12 +0100 |
commit | 62c04b47128009f80024226b1eb75a9f9f9db8c9 (patch) | |
tree | 9481a94ad554473e27e4f591d833169cd5622b12 /lib/chef/provider/apt_update.rb | |
parent | b1913dd1cc18448a2cbda81ef40886708b1ca6d0 (diff) | |
download | chef-62c04b47128009f80024226b1eb75a9f9f9db8c9.tar.gz |
Create and delete yum repositories
Signed-off-by: Thom May <thom@may.lt>
Diffstat (limited to 'lib/chef/provider/apt_update.rb')
-rw-r--r-- | lib/chef/provider/apt_update.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/chef/provider/apt_update.rb b/lib/chef/provider/apt_update.rb index 03598280c8..0320e9a83f 100644 --- a/lib/chef/provider/apt_update.rb +++ b/lib/chef/provider/apt_update.rb @@ -18,14 +18,17 @@ require "chef/provider" require "chef/provider/noop" +require "chef/mixin/which" class Chef class Provider class AptUpdate < Chef::Provider use_inline_resources + extend Chef::Mixin::Which + provides :apt_update do - uses_apt? + which("apt-get") end APT_CONF_DIR = "/etc/apt/apt.conf.d" @@ -77,11 +80,6 @@ class Chef declare_resource(:execute, "apt-get -q update") end - def self.uses_apt? - ENV["PATH"] ||= "" - paths = %w{ /bin /usr/bin /sbin /usr/sbin } + ENV["PATH"].split(::File::PATH_SEPARATOR) - paths.any? { |path| ::File.executable?(::File.join(path, "apt-get")) } - end end end end |