blob: b88287575465e1a4fadbfe9ef764aa63453f2c63 [file] [log] [blame]
package snapshots
import (
"github.com/rackspace/gophercloud"
)
func WaitForStatus(c *gophercloud.ServiceClient, id, status string, secs int) error {
return gophercloud.WaitFor(secs, func() (bool, error) {
current, err := Get(c, id).Extract()
if err != nil {
return false, err
}
if current.Status == status {
return true, nil
}
return false, nil
})
}