Clear NFS exports if an error occured in the environment in NFS
This commit is contained in:
parent
4472ce1879
commit
8dc839e0c7
|
@ -41,6 +41,7 @@ module Vagrant
|
|||
@app.call(env)
|
||||
|
||||
mount_folders if !folders.empty? && !env.error?
|
||||
clear_nfs_exports(env) if env.error?
|
||||
end
|
||||
|
||||
# Returns the folders which are to be synced via NFS.
|
||||
|
|
|
@ -37,7 +37,7 @@ class NFSVMActionTest < Test::Unit::TestCase
|
|||
setup do
|
||||
@instance.stubs(:folders).returns([:a])
|
||||
|
||||
[:extract_folders, :export_folders, :mount_folders].each do |meth|
|
||||
[:clear_nfs_exports, :extract_folders, :export_folders, :mount_folders].each do |meth|
|
||||
@instance.stubs(meth)
|
||||
end
|
||||
end
|
||||
|
@ -76,13 +76,16 @@ class NFSVMActionTest < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
should "not mount folders if an error occured" do
|
||||
@app.expects(:call).with() do
|
||||
seq = sequence("seq")
|
||||
@app.expects(:call).in_sequence(seq).with() do
|
||||
# Use this mark the env as error
|
||||
@env.error!(:foo)
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
@instance.expects(:clear_nfs_exports).with(@env).in_sequence(seq)
|
||||
|
||||
@instance.expects(:mount_folders).never
|
||||
@instance.call(@env)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue