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
|
||||
class Customize < Base
|
||||
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
|
||||
@runner.env.config.vm.run_procs!(@runner.vm)
|
||||
# Run the customization procs over the VM
|
||||
runner.env.config.vm.run_procs!(@runner.vm)
|
||||
|
||||
# Save the vm
|
||||
@runner.vm.save
|
||||
# Save the vm
|
||||
runner.vm.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,9 +7,15 @@ class CustomizeActionTest < Test::Unit::TestCase
|
|||
|
||||
context "executing" 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)
|
||||
@vm.expects(:save).once
|
||||
@action.execute!
|
||||
end
|
||||
|
||||
should "not run anything if no customize blocks exist" do
|
||||
@vm.expects(:save).never
|
||||
@action.execute!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue