From a3b9428f6747dd0ef33d58a796c4019244dc67c7 Mon Sep 17 00:00:00 2001 From: Timothy Sutton Date: Tue, 6 Aug 2013 10:18:38 -0400 Subject: [PATCH] Darwin: code debug cleanup --- plugins/guests/darwin/cap/configure_networks.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/plugins/guests/darwin/cap/configure_networks.rb b/plugins/guests/darwin/cap/configure_networks.rb index a858b7b84..6f1d4d46b 100644 --- a/plugins/guests/darwin/cap/configure_networks.rb +++ b/plugins/guests/darwin/cap/configure_networks.rb @@ -33,20 +33,14 @@ module VagrantPlugins devlist << devmap end end - puts devlist File.delete(tmpints) networks.each do |network| - intnum = network[:interface] - puts network[:interface] - puts network[:type] + service_name = devlist[network[:interface]][:service] if network[:type].to_sym == :static - # network seems 1 indexed - skip NAT interface (en0) also en1 because it seems to not *really* exist on virtualbox? - command = "networksetup -setmanual \"#{devlist[intnum][:service]}\" #{network[:ip]} #{network[:netmask]}" - + command = "networksetup -setmanual \"#{service_name}\" #{network[:ip]} #{network[:netmask]}" elsif network[:type].to_sym == :dhcp - command = "networksetup -setdhcp \"#{devlist[intnum][:service]}\"" - + command = "networksetup -setdhcp \"#{service_name}\"" end machine.communicate.sudo(command)