Properly use new networks for built-in SSH

This commit is contained in:
Mitchell Hashimoto 2013-03-01 17:07:31 -08:00
parent c586999a0b
commit 3726f8d8de
2 changed files with 6 additions and 4 deletions

View File

@ -19,8 +19,8 @@ Vagrant.configure("2") do |config|
# Share SSH locally by default
config.vm.network :forwarded_port,
host: 22,
guest: 2222,
guest: 22,
host: 2222,
id: "ssh",
auto_correct: true

View File

@ -40,7 +40,9 @@ module VagrantPlugins
# Custom merge method since some keys here are merged differently.
def merge(other)
super.tap do |result|
result.instance_variable_set(:@__networks, @__networks.merge(other.networks))
other_networks = other.instance_variable_get(:@__networks)
result.instance_variable_set(:@__networks, @__networks.merge(other_networks))
result.instance_variable_set(:@synced_folders, @synced_folders.merge(other.synced_folders))
result.instance_variable_set(:@provisioners, @provisioners + other.provisioners)
@ -107,7 +109,7 @@ module VagrantPlugins
end
# Merge in the latest settings and set the internal state
@__networks[id] ||= [type, options]
@__networks[id] = [type, options]
end
# Configures a provider for this VM.