From b63c74fad9e833419b1a40cbf5ac1edb2bcd7298 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 30 May 2010 18:09:36 -0700 Subject: [PATCH] Forwarded ports action reloads the model after clearing --- lib/vagrant/actions/vm/forward_ports.rb | 1 + test/vagrant/actions/vm/forward_ports_test.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/vagrant/actions/vm/forward_ports.rb b/lib/vagrant/actions/vm/forward_ports.rb index 78840cf22..db2ea4edb 100644 --- a/lib/vagrant/actions/vm/forward_ports.rb +++ b/lib/vagrant/actions/vm/forward_ports.rb @@ -69,6 +69,7 @@ module Vagrant def clear logger.info "Deleting any previously set forwarded ports..." @runner.vm.forwarded_ports.collect { |p| p.destroy } + @runner.reload! end def forward_ports diff --git a/test/vagrant/actions/vm/forward_ports_test.rb b/test/vagrant/actions/vm/forward_ports_test.rb index f8d478b17..47071ef4d 100644 --- a/test/vagrant/actions/vm/forward_ports_test.rb +++ b/test/vagrant/actions/vm/forward_ports_test.rb @@ -165,6 +165,7 @@ class ForwardPortsActionTest < Test::Unit::TestCase end @vm.expects(:forwarded_ports).returns(forwarded_ports) + @runner.expects(:reload!) @action.clear end end