2014-02-26 23:54:53 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module GuestLinux
|
|
|
|
module Cap
|
|
|
|
module ChooseAddressableIPAddr
|
|
|
|
def self.choose_addressable_ip_addr(machine, possible)
|
2016-06-05 18:46:43 +00:00
|
|
|
comm = machine.communicate
|
|
|
|
|
|
|
|
possible.each do |ip|
|
2016-07-13 16:01:17 +00:00
|
|
|
if comm.test("ping -c1 -w1 -W1 #{ip}")
|
2016-06-05 18:46:43 +00:00
|
|
|
return ip
|
2014-02-26 23:54:53 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2016-07-13 16:01:17 +00:00
|
|
|
return nil
|
2014-02-26 23:54:53 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|