Remove customize action, this will need rethinking
This commit is contained in:
parent
7a70755362
commit
177eb828af
|
@ -29,9 +29,6 @@ module Vagrant
|
||||||
use VM::ShareFolders
|
use VM::ShareFolders
|
||||||
use VM::HostName
|
use VM::HostName
|
||||||
use VM::Network
|
use VM::Network
|
||||||
# TODO: Bring back some sort of "customize" feature.
|
|
||||||
# use VM::Customize
|
|
||||||
# use VM::Modify
|
|
||||||
use VM::Boot
|
use VM::Boot
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
module Vagrant
|
|
||||||
module Action
|
|
||||||
module VM
|
|
||||||
class Customize
|
|
||||||
def initialize(app, env)
|
|
||||||
@app = app
|
|
||||||
end
|
|
||||||
|
|
||||||
def call(env)
|
|
||||||
if !env[:vm].config.vm.proc_stack.empty?
|
|
||||||
# Create the proc which runs all of our procs
|
|
||||||
proc = lambda do |vm|
|
|
||||||
env[:ui].info I18n.t("vagrant.actions.vm.customize.running")
|
|
||||||
env[:vm].config.vm.run_procs!(vm)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Add it to modify sequence
|
|
||||||
env["vm.modify"].call(proc)
|
|
||||||
end
|
|
||||||
|
|
||||||
@app.call(env)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,37 +0,0 @@
|
||||||
module Vagrant
|
|
||||||
module Action
|
|
||||||
module VM
|
|
||||||
# This class allows other actions on the virtual machine object
|
|
||||||
# to be consolidated under a single write lock. This vastly speeds
|
|
||||||
# up modification of virtual machines. This should be used whereever
|
|
||||||
# possible when dealing with virtual machine modifications.
|
|
||||||
class Modify
|
|
||||||
include Util::StackedProcRunner
|
|
||||||
|
|
||||||
def initialize(app, env)
|
|
||||||
@app = app
|
|
||||||
|
|
||||||
# Initialize the proc_stack, which should already be empty
|
|
||||||
# but just making sure here.
|
|
||||||
proc_stack.clear
|
|
||||||
|
|
||||||
# Create the lambda in the environment which is to be called
|
|
||||||
# to add new procs to the modification sequence.
|
|
||||||
env["vm.modify"] = lambda do |*procs|
|
|
||||||
procs.each { |p| push_proc(&p) }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def call(env)
|
|
||||||
# Run the procs we have saved up, save the machine, and reload
|
|
||||||
# to verify we get the new settings
|
|
||||||
run_procs!(env[:vm].vm)
|
|
||||||
env[:vm].vm.save
|
|
||||||
env[:vm].reload!
|
|
||||||
|
|
||||||
@app.call(env)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in New Issue