NFS no longer attempts to clean exports file if VM is not created, which caused a stack trace during recovery.

This commit is contained in:
Mitchell Hashimoto 2010-09-30 01:16:45 -07:00
parent ed645417c7
commit bad251a20d
3 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,7 @@
## 0.6.4 (unreleased)
- NFS no longer attempts to clean exports file if VM is not created,
which was causing a stack trace during recovery. [related to GH-166]
- Basic validation added for Chef configuration (both solo and server).
- Top config class is now available in all `Vagrant::Config::Base`
subclasses, which is useful for config validation.

View File

@ -42,7 +42,7 @@ module Vagrant
end
def recover(env)
clear_nfs_exports(env)
clear_nfs_exports(env) if env["vm"].created?
end
# Returns the folders which are to be synced via NFS.

View File

@ -68,10 +68,20 @@ class NFSVMActionTest < Test::Unit::TestCase
end
context "recovery" do
setup do
@vm.stubs(:created?).returns(true)
end
should "clear NFS exports" do
@instance.expects(:clear_nfs_exports).with(@env).once
@instance.recover(@env)
end
should "do nothing if VM is not created" do
@vm.stubs(:created?).returns(false)
@instance.expects(:clear_nfs_exports).never
@instance.recover(@env)
end
end
context "extracting folders" do