Don't run VM customizations if none were specified
This commit is contained in:
parent
50262cfb66
commit
b00442026f
|
@ -3,13 +3,15 @@ module Vagrant
|
||||||
module VM
|
module VM
|
||||||
class Customize < Base
|
class Customize < Base
|
||||||
def execute!
|
def execute!
|
||||||
logger.info "Running any VM customizations..."
|
if !runner.env.config.vm.proc_stack.empty?
|
||||||
|
logger.info "Running any VM customizations..."
|
||||||
|
|
||||||
# Run the customization procs over the VM
|
# Run the customization procs over the VM
|
||||||
@runner.env.config.vm.run_procs!(@runner.vm)
|
runner.env.config.vm.run_procs!(@runner.vm)
|
||||||
|
|
||||||
# Save the vm
|
# Save the vm
|
||||||
@runner.vm.save
|
runner.vm.save
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,9 +7,15 @@ class CustomizeActionTest < Test::Unit::TestCase
|
||||||
|
|
||||||
context "executing" do
|
context "executing" do
|
||||||
should "run the VM customization procs then save the VM" do
|
should "run the VM customization procs then save the VM" do
|
||||||
|
@runner.env.config.vm.customize { |vm| }
|
||||||
@runner.env.config.vm.expects(:run_procs!).with(@vm)
|
@runner.env.config.vm.expects(:run_procs!).with(@vm)
|
||||||
@vm.expects(:save).once
|
@vm.expects(:save).once
|
||||||
@action.execute!
|
@action.execute!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "not run anything if no customize blocks exist" do
|
||||||
|
@vm.expects(:save).never
|
||||||
|
@action.execute!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue