From 90289544d48e20e9dffd62af56b48592a914bd54 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 6 Sep 2013 00:26:39 -0700 Subject: [PATCH] core: handle EACCES when cleaning up .vagrant dir --- CHANGELOG.md | 2 ++ lib/vagrant/machine.rb | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99d4fd0af..4e273840e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ BUG FIXES: Vagrantfile name. [GH-2130] - core: Fix an issue where the data directory would be deleted too quickly in a multi-VM environment. + - core: Handle the case where we get an EACCES cleaning up the .vagrant + directory. - provisioners/chef: Work even with restrictive umask on user. [GH-2121] - provisioners/chef: Fix environment validation to be less restrictive. - provisioners/puppet: No more "shared folders cannot be found" error. diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 942e833ca..b36123a4d 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -211,7 +211,11 @@ module Vagrant # Delete the entire data directory contents since all state # associated with the VM is now gone. @data_dir.children.each do |child| - child.rmtree + begin + child.rmtree + rescue Errno::EACCES + @logger.info("EACCESS deleting file: #{child}") + end end end