summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPhil Dibowitz <phil@ipom.com>2016-06-06 18:35:16 +0100
committerPhil Dibowitz <phil@ipom.com>2016-06-06 18:35:16 +0100
commit45419b1d57c6303bca910dea0270b5c2b0b6efe4 (patch)
treed6eb0dc342b223cca2b4d55b2571e56777398b4a /lib
parent8c9b41f3ec6b28c110439b53731a3111aa29437e (diff)
downloadchef-45419b1d57c6303bca910dea0270b5c2b0b6efe4.tar.gz
Don't mask directory deletion errors (#4991)
closes #4988
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/provider/directory.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/provider/directory.rb b/lib/chef/provider/directory.rb
index 7cc05259b6..619ab5d8b6 100644
--- a/lib/chef/provider/directory.rb
+++ b/lib/chef/provider/directory.rb
@@ -145,7 +145,9 @@ class Chef
if ::File.exists?(@new_resource.path)
converge_by("delete existing directory #{@new_resource.path}") do
if @new_resource.recursive == true
- FileUtils.rm_rf(@new_resource.path)
+ # we don't use rm_rf here because it masks all errors, including
+ # IO errors or permission errors that would prvent the deletion
+ FileUtils.rm_r(@new_resource.path)
Chef::Log.info("#{@new_resource} deleted #{@new_resource.path} recursively")
else
::Dir.delete(@new_resource.path)