Run provisioner cleanup tasks before destroying the VM

This commit is contained in:
Seth Vargo 2015-11-18 20:23:21 -08:00
parent ad897aed39
commit 825bd6d5ef
3 changed files with 4 additions and 2 deletions

View File

@ -156,12 +156,12 @@ module VagrantPlugins
b3.use Call, DestroyConfirm do |env3, b4| b3.use Call, DestroyConfirm do |env3, b4|
if env3[:result] if env3[:result]
b4.use ConfigValidate b4.use ConfigValidate
b4.use ProvisionerCleanup, :before
b4.use EnvSet, force_halt: true b4.use EnvSet, force_halt: true
b4.use action_halt b4.use action_halt
b4.use HostMachineSyncFoldersDisable b4.use HostMachineSyncFoldersDisable
b4.use Destroy b4.use Destroy
b4.use DestroyBuildImage b4.use DestroyBuildImage
b4.use ProvisionerCleanup
else else
b4.use Message, b4.use Message,
I18n.t("docker_provider.messages.will_not_destroy") I18n.t("docker_provider.messages.will_not_destroy")

View File

@ -38,6 +38,7 @@ module VagrantPlugins
end end
b2.use ConfigValidate b2.use ConfigValidate
b4.use ProvisionerCleanup, :before
b2.use StopInstance b2.use StopInstance
b2.use DeleteVM b2.use DeleteVM
end end

View File

@ -95,13 +95,14 @@ module VagrantPlugins
b2.use Call, DestroyConfirm do |env2, b3| b2.use Call, DestroyConfirm do |env2, b3|
if env2[:result] if env2[:result]
b3.use ConfigValidate
b3.use ProvisionerCleanup, :before
b3.use CheckAccessible b3.use CheckAccessible
b3.use EnvSet, force_halt: true b3.use EnvSet, force_halt: true
b3.use action_halt b3.use action_halt
b3.use Destroy b3.use Destroy
b3.use CleanMachineFolder b3.use CleanMachineFolder
b3.use DestroyUnusedNetworkInterfaces b3.use DestroyUnusedNetworkInterfaces
b3.use ProvisionerCleanup
b3.use PrepareNFSValidIds b3.use PrepareNFSValidIds
b3.use SyncedFolderCleanup b3.use SyncedFolderCleanup
else else