def wait_until_host_is_available(host, get_ip=false)
      resolved_host = Resolv.getaddresses(host).first
      if resolved_host.nil?
        print("Waiting for #{host} to resolve")
        wait_until('ready!') { resolved_host = Resolv.getaddresses(host).first }
      end
      host = resolved_host if get_ip
      unless remote_is_available?(host)
        print("Waiting for #{host} to accept connections")
        wait_until('ready!') { remote_is_available?(host) }
      end
      return host
    end
def wait_until_host_is_available(host, get_ip=false)
      resolved_host = Resolv.getaddresses(host).first
      if resolved_host.nil?
        print("Waiting for #{host} to resolve")
        wait_until('ready!') { resolved_host = Resolv.getaddresses(host).first }
      end
      host = resolved_host if get_ip
      unless remote_is_available?(host)
        print("Waiting for #{host} to accept connections")
        wait_until('ready!') { remote_is_available?(host) }
      end
      return host
    end
Can take a host name or an ip address. Resolves the host name
 and returns the ip address if get_ip is passed in as true.