summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2015-08-14 10:30:16 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-08-20 00:18:58 -0700
commitac0ad9eb0a99f72e718d9f9bb4fae1caf48ae890 (patch)
tree154a7a300c68dcd60991d4d870eb4295b2ffb32f /lib/chef
parent42582687f5a9e3f766e6f016e43db4477010a56e (diff)
downloadchef-ac0ad9eb0a99f72e718d9f9bb4fae1caf48ae890.tar.gz
fixes from code review
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/provider/package/yum.rb6
-rw-r--r--lib/chef/resource/yum_package.rb2
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/provider/package/yum.rb b/lib/chef/provider/package/yum.rb
index de23ed22b9..81454380a3 100644
--- a/lib/chef/provider/package/yum.rb
+++ b/lib/chef/provider/package/yum.rb
@@ -986,7 +986,11 @@ class Chef
end
def yum_binary
- new_resource.is_a?(Chef::Resource::YumPackage) ? new_resource.yum_binary : "yum"
+ @yum_binary ||=
+ begin
+ yum_binary = new_resource.yum_binary if new_resource.is_a?(Chef::Resource::YumPackage)
+ yum_binary ||= ::File.exist?("/usr/bin/yum-deprecated") ? "yum-deprecated" : "yum"
+ end
end
# Extra attributes
diff --git a/lib/chef/resource/yum_package.rb b/lib/chef/resource/yum_package.rb
index df50022157..50ba13ce65 100644
--- a/lib/chef/resource/yum_package.rb
+++ b/lib/chef/resource/yum_package.rb
@@ -28,7 +28,7 @@ class Chef
super
@flush_cache = { :before => false, :after => false }
@allow_downgrade = false
- @yum_binary = ::File.exist?("/usr/bin/yum-deprecated") ? "yum-deprecated" : "yum"
+ @yum_binary = nil
end
# Install a specific arch