示例#1
0
文件: polling.go 项目: jameinel/core
// WaitDNSName is an implementation that the providers can use.  It builds on
// the provider's implementation of Instance.DNSName.
func WaitDNSName(inst instance.Instance) (string, error) {
	for a := LongAttempt.Start(); a.Next(); {
		name, err := inst.DNSName()
		if err == nil || err != instance.ErrNoDNSName {
			return name, err
		}
	}
	return "", fmt.Errorf("timed out trying to get DNS address for %v", inst.Id())
}