summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Danna <steve@opscode.com>2014-06-20 10:06:10 -0700
committerSteven Danna <steve@opscode.com>2014-06-20 10:06:10 -0700
commit4d3501858c394d9efc5d2ee17dd0379c06c94e64 (patch)
tree4d5a999a4c3898ff2f0a0416f4e1025b6528a9af
parent633204305f8accc3110f07fc210d86b7c6a76070 (diff)
parent937da3a2e3b1afd970acbc596d42fee372e056c1 (diff)
downloadchef-4d3501858c394d9efc5d2ee17dd0379c06c94e64.tar.gz
Merge pull request #1519 from opscode/ssd/purge-ignore-missing-on-purge
[chef_fs/file_system] Ignore missing entry at destination when purging
-rw-r--r--lib/chef/chef_fs/file_system.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/chef_fs/file_system.rb b/lib/chef/chef_fs/file_system.rb
index 9fe726744e..ffbe274864 100644
--- a/lib/chef/chef_fs/file_system.rb
+++ b/lib/chef/chef_fs/file_system.rb
@@ -285,8 +285,12 @@ class Chef
if options[:dry_run]
ui.output "Would delete #{dest_path}" if ui
else
- dest_entry.delete(true)
- ui.output "Deleted extra entry #{dest_path} (purge is on)" if ui
+ begin
+ dest_entry.delete(true)
+ ui.output "Deleted extra entry #{dest_path} (purge is on)" if ui
+ rescue Chef::ChefFS::FileSystem::NotFoundError
+ ui.output "Entry #{dest_path} does not exist. Nothing to do. (purge is on)" if ui
+ end
end
else
ui.output ("Not deleting extra entry #{dest_path} (purge is off)") if ui