Merge branch 'nfs-sync-folder-cleanup' of https://github.com/emyl/vagrant into emyl-nfs-sync-folder-cleanup

Conflicts:
	plugins/providers/virtualbox/action.rb
This commit is contained in:
Mitchell Hashimoto 2013-12-06 15:06:34 -08:00
commit 55931d507e
3 changed files with 7 additions and 23 deletions

View File

@ -34,7 +34,6 @@ module VagrantPlugins
autoload :PackageVagrantfile, File.expand_path("../action/package_vagrantfile", __FILE__)
autoload :PrepareNFSSettings, File.expand_path("../action/prepare_nfs_settings", __FILE__)
autoload :PrepareForwardedPortCollisionParams, File.expand_path("../action/prepare_forwarded_port_collision_params", __FILE__)
autoload :PruneNFSExports, File.expand_path("../action/prune_nfs_exports", __FILE__)
autoload :Resume, File.expand_path("../action/resume", __FILE__)
autoload :SaneDefaults, File.expand_path("../action/sane_defaults", __FILE__)
autoload :SetName, File.expand_path("../action/set_name", __FILE__)
@ -57,7 +56,6 @@ module VagrantPlugins
b.use EnvSet, :port_collision_repair => true
b.use PrepareForwardedPortCollisionParams
b.use HandleForwardedPortCollisions
b.use PruneNFSExports
b.use SyncedFolderCleanup
b.use SyncedFolders
b.use PrepareNFSSettings
@ -91,7 +89,6 @@ module VagrantPlugins
b3.use CheckAccessible
b3.use EnvSet, :force_halt => true
b3.use action_halt
b3.use PruneNFSExports
b3.use Destroy
b3.use CleanMachineFolder
b3.use DestroyUnusedNetworkInterfaces

View File

@ -1,20 +0,0 @@
module VagrantPlugins
module ProviderVirtualBox
module Action
class PruneNFSExports
def initialize(app, env)
@app = app
end
def call(env)
if env[:host]
vms = env[:machine].provider.driver.read_vms
env[:host].nfs_prune(vms.values)
end
@app.call(env)
end
end
end
end
end

View File

@ -51,6 +51,13 @@ module VagrantPlugins
:mount_nfs_folder, nfsopts[:nfs_host_ip], mount_folders)
end
def cleanup(machine)
# Get the ID of all active machines.
ids = machine.env.active_machines.map { |m| machine.env.machine(m[0], m[1]).id }
machine.env.host.nfs_prune(ids)
end
protected
def prepare_folder(machine, opts)