mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
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:
commit
5c65625fe8
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user