From c95fc4e27c59954ae574ee9a54fd872e33704146 Mon Sep 17 00:00:00 2001 From: Emiliano Ticci Date: Wed, 4 Dec 2013 12:22:01 +0100 Subject: [PATCH] VirtualBox shared folders: remove dedicated cleanup action in favour of native routine. --- plugins/providers/virtualbox/action.rb | 4 +--- .../virtualbox/action/clear_shared_folders.rb | 17 ----------------- plugins/providers/virtualbox/synced_folder.rb | 4 ++++ 3 files changed, 5 insertions(+), 20 deletions(-) delete mode 100644 plugins/providers/virtualbox/action/clear_shared_folders.rb diff --git a/plugins/providers/virtualbox/action.rb b/plugins/providers/virtualbox/action.rb index 70b83f3f3..3d5bb67d5 100644 --- a/plugins/providers/virtualbox/action.rb +++ b/plugins/providers/virtualbox/action.rb @@ -12,7 +12,6 @@ module VagrantPlugins autoload :CleanMachineFolder, File.expand_path("../action/clean_machine_folder", __FILE__) autoload :ClearForwardedPorts, File.expand_path("../action/clear_forwarded_ports", __FILE__) autoload :ClearNetworkInterfaces, File.expand_path("../action/clear_network_interfaces", __FILE__) - autoload :ClearSharedFolders, File.expand_path("../action/clear_shared_folders", __FILE__) autoload :Created, File.expand_path("../action/created", __FILE__) autoload :Customize, File.expand_path("../action/customize", __FILE__) autoload :Destroy, File.expand_path("../action/destroy", __FILE__) @@ -59,7 +58,6 @@ module VagrantPlugins b.use PrepareForwardedPortCollisionParams b.use HandleForwardedPortCollisions b.use PruneNFSExports - b.use ClearSharedFolders b.use SyncedFolderCleanup b.use SyncedFolders b.use PrepareNFSSettings @@ -148,7 +146,7 @@ module VagrantPlugins b2.use CheckAccessible b2.use action_halt b2.use ClearForwardedPorts - b2.use ClearSharedFolders + b2.use SyncedFolderCleanup b2.use Export b2.use PackageVagrantfile b2.use Package diff --git a/plugins/providers/virtualbox/action/clear_shared_folders.rb b/plugins/providers/virtualbox/action/clear_shared_folders.rb deleted file mode 100644 index 1aa617ff1..000000000 --- a/plugins/providers/virtualbox/action/clear_shared_folders.rb +++ /dev/null @@ -1,17 +0,0 @@ -module VagrantPlugins - module ProviderVirtualBox - module Action - class ClearSharedFolders - def initialize(app, env) - @app = app - end - - def call(env) - env[:machine].provider.driver.clear_shared_folders - - @app.call(env) - end - end - end - end -end diff --git a/plugins/providers/virtualbox/synced_folder.rb b/plugins/providers/virtualbox/synced_folder.rb index 85feb1618..47b9c945e 100644 --- a/plugins/providers/virtualbox/synced_folder.rb +++ b/plugins/providers/virtualbox/synced_folder.rb @@ -61,6 +61,10 @@ module VagrantPlugins end end + def cleanup(machine) + driver.clear_shared_folders + end + protected # This is here so that we can stub it for tests