diff --git a/lib/vagrant/actions/vm/forward_ports.rb b/lib/vagrant/actions/vm/forward_ports.rb index 496177639..8f959e7ec 100644 --- a/lib/vagrant/actions/vm/forward_ports.rb +++ b/lib/vagrant/actions/vm/forward_ports.rb @@ -108,7 +108,7 @@ module Vagrant else # VirtualBox 3.2.x uses forwarded ports via NAT engines vm.network_adapters.collect do |na| - na.nat_engine.forwarded_ports.collect do |fp| + na.nat_driver.forwarded_ports.collect do |fp| fp.hostport.to_s end end @@ -126,7 +126,7 @@ module Vagrant fp.each { |p| p.destroy } else runner.vm.network_adapters.each do |na| - na.nat_engine.forwarded_ports.dup.each do |fp| + na.nat_driver.forwarded_ports.dup.each do |fp| fp.destroy end end @@ -147,7 +147,7 @@ module Vagrant port.name = name port.guestport = options[:guestport] port.hostport = options[:hostport] - runner.vm.network_adapters[options[:adapter]].nat_engine.forwarded_ports << port + runner.vm.network_adapters[options[:adapter]].nat_driver.forwarded_ports << port end end end diff --git a/lib/vagrant/ssh.rb b/lib/vagrant/ssh.rb index ac1f5fe61..62c088fdd 100644 --- a/lib/vagrant/ssh.rb +++ b/lib/vagrant/ssh.rb @@ -140,7 +140,7 @@ module Vagrant # VirtualBox 3.2 specific pnum = nil env.vm.vm.network_adapters.each do |na| - pnum = na.nat_engine.forwarded_ports.detect do |fp| + pnum = na.nat_driver.forwarded_ports.detect do |fp| fp.name == env.config.ssh.forwarded_port_key end diff --git a/test/vagrant/actions/vm/forward_ports_test.rb b/test/vagrant/actions/vm/forward_ports_test.rb index 8de1dcf47..65c8991a9 100644 --- a/test/vagrant/actions/vm/forward_ports_test.rb +++ b/test/vagrant/actions/vm/forward_ports_test.rb @@ -194,7 +194,7 @@ class ForwardPortsActionTest < Test::Unit::TestCase fps = [mock_fp(2222), mock_fp(80)] na = mock("na") ne = mock("ne") - na.stubs(:nat_engine).returns(ne) + na.stubs(:nat_driver).returns(ne) ne.stubs(:forwarded_ports).returns(fps) @vms << mock_vm(:network_adapters => [na]) assert_equal %W[2222 80], @action.used_ports @@ -233,7 +233,7 @@ class ForwardPortsActionTest < Test::Unit::TestCase na = mock("adapter") engine = mock("engine") engine.stubs(:forwarded_ports).returns([mock_fp]) - na.stubs(:nat_engine).returns(engine) + na.stubs(:nat_driver).returns(engine) na end @@ -280,7 +280,7 @@ class ForwardPortsActionTest < Test::Unit::TestCase adapter = mock("adapter") engine = mock("engine") fps = mock("forwarded ports") - adapter.stubs(:nat_engine).returns(engine) + adapter.stubs(:nat_driver).returns(engine) engine.stubs(:forwarded_ports).returns(fps) fps.expects(:<<).with do |port| assert_equal name, port.name