func waitForImageCreation(api *cloudapi.Client, id string, timeout time.Duration) error { return waitFor( func() (bool, error) { image, err := api.GetImage(id) return image.OS != "", err }, 3*time.Second, timeout, ) }