Merge pull request #356 from dcbw/dcbw/fix-vm-ip-multiple-leases

Fix retrieving VM IP address if there are multiple leases for the same VM
This commit is contained in:
Dmitry Vasilets 2015-05-02 08:57:23 +02:00
commit d107b899c8

View File

@ -34,7 +34,9 @@ module VagrantPlugins
ip_address = nil ip_address = nil
domain.wait_for(2) { domain.wait_for(2) {
addresses.each_pair do |type, ip| addresses.each_pair do |type, ip|
ip_address = ip[0] if ip[0] != nil # Multiple leases are separated with a newline, return only
# the most recent address
ip_address = ip[0].split("\n").first if ip[0] != nil
end end
ip_address != nil ip_address != nil
} }