filter host IPs to those that resolve on guest when finding addresable IPs on a windows guest

This commit is contained in:
Matt Wrock 2014-08-08 21:18:16 -07:00
parent e64f84491e
commit d820bef6f4
1 changed files with 4 additions and 1 deletions

View File

@ -5,7 +5,10 @@ module VagrantPlugins
def self.choose_addressable_ip_addr(machine, possible)
machine.communicate.tap do |comm|
possible.each do |ip|
return ip
command = "ping -n 1 -w 1 #{ip}"
if comm.test(command)
return ip
end
end
end