s/nat engine/nat driver/

This commit is contained in:
Mitchell Hashimoto 2010-06-17 22:38:25 -07:00
parent d257703496
commit e6760d8f5b
3 changed files with 7 additions and 7 deletions

View File

@ -108,7 +108,7 @@ module Vagrant
else else
# VirtualBox 3.2.x uses forwarded ports via NAT engines # VirtualBox 3.2.x uses forwarded ports via NAT engines
vm.network_adapters.collect do |na| 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 fp.hostport.to_s
end end
end end
@ -126,7 +126,7 @@ module Vagrant
fp.each { |p| p.destroy } fp.each { |p| p.destroy }
else else
runner.vm.network_adapters.each do |na| 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 fp.destroy
end end
end end
@ -147,7 +147,7 @@ module Vagrant
port.name = name port.name = name
port.guestport = options[:guestport] port.guestport = options[:guestport]
port.hostport = options[:hostport] 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 end
end end

View File

@ -140,7 +140,7 @@ module Vagrant
# VirtualBox 3.2 specific # VirtualBox 3.2 specific
pnum = nil pnum = nil
env.vm.vm.network_adapters.each do |na| 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 fp.name == env.config.ssh.forwarded_port_key
end end

View File

@ -194,7 +194,7 @@ class ForwardPortsActionTest < Test::Unit::TestCase
fps = [mock_fp(2222), mock_fp(80)] fps = [mock_fp(2222), mock_fp(80)]
na = mock("na") na = mock("na")
ne = mock("ne") ne = mock("ne")
na.stubs(:nat_engine).returns(ne) na.stubs(:nat_driver).returns(ne)
ne.stubs(:forwarded_ports).returns(fps) ne.stubs(:forwarded_ports).returns(fps)
@vms << mock_vm(:network_adapters => [na]) @vms << mock_vm(:network_adapters => [na])
assert_equal %W[2222 80], @action.used_ports assert_equal %W[2222 80], @action.used_ports
@ -233,7 +233,7 @@ class ForwardPortsActionTest < Test::Unit::TestCase
na = mock("adapter") na = mock("adapter")
engine = mock("engine") engine = mock("engine")
engine.stubs(:forwarded_ports).returns([mock_fp]) engine.stubs(:forwarded_ports).returns([mock_fp])
na.stubs(:nat_engine).returns(engine) na.stubs(:nat_driver).returns(engine)
na na
end end
@ -280,7 +280,7 @@ class ForwardPortsActionTest < Test::Unit::TestCase
adapter = mock("adapter") adapter = mock("adapter")
engine = mock("engine") engine = mock("engine")
fps = mock("forwarded ports") fps = mock("forwarded ports")
adapter.stubs(:nat_engine).returns(engine) adapter.stubs(:nat_driver).returns(engine)
engine.stubs(:forwarded_ports).returns(fps) engine.stubs(:forwarded_ports).returns(fps)
fps.expects(:<<).with do |port| fps.expects(:<<).with do |port|
assert_equal name, port.name assert_equal name, port.name