From 1c9af032e74a75259484e197a3c56456cf7edd76 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 1 Mar 2013 16:37:37 -0800 Subject: [PATCH] V1 upgrading works with the new network syntax --- 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 eb4e359b4..21a4c10dd 100644 --- a/plugins/kernel_v1/config/vm.rb +++ b/plugins/kernel_v1/config/vm.rb @@ -127,7 +127,18 @@ module VagrantPlugins next end - new.vm.network(type, *args) + options = {} + options = args.pop.dup if args.last.is_a?(Hash) + + # Determine the extra options we need to set for each type + if type == :forwarded_port + options[:guest] = args[0] + options[:host] = args[1] + elsif type == :private_network + options[:ip] = args[0] + end + + new.vm.network(type, options) end # Provisioners