From 965427c540c20281ad7d426eda204ebbbe09628a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 13 Jan 2013 01:07:55 -0800 Subject: [PATCH] Properly upgrade V1 hostonly/bridged networks to V2 config --- plugins/kernel_v1/config/vm.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/kernel_v1/config/vm.rb b/plugins/kernel_v1/config/vm.rb index 1c9f8b53e..03f928c8b 100644 --- a/plugins/kernel_v1/config/vm.rb +++ b/plugins/kernel_v1/config/vm.rb @@ -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