From 8d32002c02b0cf70bfd1dda71643f53a42a68a73 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 7 Jan 2012 22:01:06 -0800 Subject: [PATCH] Don't clear NFS exports on expected failure [GH-577] --- CHANGELOG.md | 1 + lib/vagrant/action/vm/nfs.rb | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 878b65519..8453eb96c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ - `vagrant ssh -c` will now send stderr to stderr and stdout to stdout on the host machine, instead of all output to stdout. - Vagrant can now be interrupted during the "importing" step. + - NFS exports will no longer be cleared when an expected error occurs. [GH-577] ## 0.8.10 (December 10, 2011) diff --git a/lib/vagrant/action/vm/nfs.rb b/lib/vagrant/action/vm/nfs.rb index a82a85264..0bb171e45 100644 --- a/lib/vagrant/action/vm/nfs.rb +++ b/lib/vagrant/action/vm/nfs.rb @@ -42,7 +42,12 @@ module Vagrant end def recover(env) - clear_nfs_exports(env) if env[:vm].created? + # Ignore any VagrantErrors, because they were expected and + # will cause the VM to stick around. + return if env["vagrant.error"].is_a?(Errors::VagrantError) + + # Otherwise, clear the NFS exports. + clear_nfs_exports(env) end # Returns the folders which are to be synced via NFS.