Merge pull request #423 from anduslim/master

Ensure IP is a string and not an array before connecting via UDP socket.
This commit is contained in:
Dmitry Vasilets 2015-07-23 07:59:38 +02:00
commit 5c65625fe8

View File

@ -41,8 +41,13 @@ module VagrantPlugins
# @return [String]
def read_host_ip(ip)
UDPSocket.open do |s|
s.connect(ip, 1)
s.addr.last
@logger.info("!!!! ALL IPs #{ip} #{ip.kind_of?(Array)}" )
if ip.kind_of?(Array)
s.connect(ip[0], 1)
else
s.connect(ip, 1)
end
s.addr.last
end
end