def get_ipaddress(machine)
domain = get_domain(machine.id)
if @machine.provider_config.qemu_use_session
return get_ipaddress_system domain.mac
end
if domain.nil?
return nil
end
ip_address = nil
begin
domain.wait_for(2) do
addresses.each_pair do |_type, ip|
ip_address = ip[0].split("\n").first unless ip[0].nil?
end
!ip_address.nil?
end
rescue Fog::Errors::TimeoutError
@logger.info('Timeout at waiting for an ip address for machine %s' % machine.name)
end
unless ip_address
@logger.info('No arp table entry found for machine %s' % machine.name)
return nil
end
ip_address
end