Properly use new networks for built-in SSH
This commit is contained in:
parent
c586999a0b
commit
3726f8d8de
|
@ -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
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue