2014-07-17 10:13:50 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module GuestWindows
|
|
|
|
module Cap
|
|
|
|
module ChooseAddressableIPAddr
|
|
|
|
def self.choose_addressable_ip_addr(machine, possible)
|
|
|
|
machine.communicate.tap do |comm|
|
|
|
|
possible.each do |ip|
|
2014-08-09 04:18:16 +00:00
|
|
|
command = "ping -n 1 -w 1 #{ip}"
|
|
|
|
if comm.test(command)
|
|
|
|
return ip
|
|
|
|
end
|
2014-07-17 10:13:50 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|