Properly upgrade V1 hostonly/bridged networks to V2 config

This commit is contained in:
Mitchell Hashimoto 2013-01-13 01:07:55 -08:00
parent 212e634c3b
commit 965427c540
1 changed files with 12 additions and 1 deletions

View File

@ -51,7 +51,13 @@ module VagrantPlugins
end
def network(type, *args)
@networks << [type, args]
if type == :hostonly
@networks << [:private_network, args]
elsif type == :bridged
@networks << [:public_network, args]
else
@networks << [:unknown, type]
end
end
def provision(name, options=nil, &block)
@ -98,6 +104,11 @@ module VagrantPlugins
# Re-define all networks.
self.networks.each do |type, args|
if type == :unknown
# TODO: Warn that we don't know what the heck this is.
next
end
new.vm.network(type, *args)
end