mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Ensure IP is a string and not an array before connecting via UDP socket.
This commit is contained in:
parent
c834ba3285
commit
d90da43f85
@ -41,8 +41,13 @@ module VagrantPlugins
|
|||||||
# @return [String]
|
# @return [String]
|
||||||
def read_host_ip(ip)
|
def read_host_ip(ip)
|
||||||
UDPSocket.open do |s|
|
UDPSocket.open do |s|
|
||||||
s.connect(ip, 1)
|
@logger.info("!!!! ALL IPs #{ip} #{ip.kind_of?(Array)}" )
|
||||||
s.addr.last
|
if ip.kind_of?(Array)
|
||||||
|
s.connect(ip[0], 1)
|
||||||
|
else
|
||||||
|
s.connect(ip, 1)
|
||||||
|
end
|
||||||
|
s.addr.last
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user