Add virtualbox cleanup_disks action
This commit is contained in:
parent
cc8ed8a616
commit
e4a57a8e1d
@ -12,6 +12,7 @@ module Vagrant
|
||||
autoload :BoxCheckOutdated, "vagrant/action/builtin/box_check_outdated"
|
||||
autoload :BoxRemove, "vagrant/action/builtin/box_remove"
|
||||
autoload :Call, "vagrant/action/builtin/call"
|
||||
autoload :CleanupDisks, "vagrant/action/builtin/cleanup_disks"
|
||||
autoload :Confirm, "vagrant/action/builtin/confirm"
|
||||
autoload :ConfigValidate, "vagrant/action/builtin/config_validate"
|
||||
autoload :DestroyConfirm, "vagrant/action/builtin/destroy_confirm"
|
||||
|
||||
@ -79,6 +79,7 @@ module VagrantPlugins
|
||||
b.use ForwardPorts
|
||||
b.use SetHostname
|
||||
b.use SaneDefaults
|
||||
b.use CleanupDisks
|
||||
b.use Disk
|
||||
b.use Customize, "pre-boot"
|
||||
b.use Boot
|
||||
|
||||
23
plugins/providers/virtualbox/cap/cleanup_disks.rb
Normal file
23
plugins/providers/virtualbox/cap/cleanup_disks.rb
Normal file
@ -0,0 +1,23 @@
|
||||
require "log4r"
|
||||
require "vagrant/util/numeric"
|
||||
require "vagrant/util/experimental"
|
||||
|
||||
module VagrantPlugins
|
||||
module ProviderVirtualBox
|
||||
module Cap
|
||||
module CleanupDisks
|
||||
LOGGER = Log4r::Logger.new("vagrant::plugins::virtualbox::cleanup_disks")
|
||||
|
||||
# @param [Vagrant::Machine] machine
|
||||
# @param [VagrantPlugins::Kernel_V2::VagrantConfigDisk] defined_disks
|
||||
def self.cleanup_disks(machine, defined_disks)
|
||||
return if defined_disks.empty?
|
||||
|
||||
return if !Vagrant::Util::Experimental.feature_enabled?("virtualbox_disk_hdd")
|
||||
end
|
||||
|
||||
protected
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user