summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Doherty <cdoherty@chef.io>2016-02-25 14:39:23 -0800
committerChris Doherty <cdoherty@chef.io>2016-02-25 15:51:22 -0800
commit37baee5b73d568ac9562bba6ebae0472b8146e85 (patch)
tree1a045618dd99fcb4ef68e533da7e50fb23ec94a2
parent588a0a63590631e40e364d7eb1918d9461c7801c (diff)
downloadchef-cd/fix-choco-error.tar.gz
Meant to use the value from the if..then, then put a line above the if.cd/fix-choco-error
-rw-r--r--lib/chef/provider/package/chocolatey.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/chef/provider/package/chocolatey.rb b/lib/chef/provider/package/chocolatey.rb
index 96ec8c0a8c..44fb1de235 100644
--- a/lib/chef/provider/package/chocolatey.rb
+++ b/lib/chef/provider/package/chocolatey.rb
@@ -147,15 +147,13 @@ EOS
#
# @return [String] full path of choco.exe
def choco_exe
- @choco_exe ||=
+ @choco_exe ||= begin
# if this check is in #define_resource_requirements, it won't get
# run before choco.exe gets called from #load_current_resource.
exe_path = ::File.join(choco_install_path.to_s, "bin", "choco.exe")
- if !::File.exist?(exe_path)
- raise Chef::Exceptions::MissingLibrary, CHOCO_MISSING_MSG
- else
- exe_path
- end
+ raise Chef::Exceptions::MissingLibrary, CHOCO_MISSING_MSG unless ::File.exist?(exe_path)
+ exe_path
+ end
end
# lets us mock out an incorrect value for testing.