blob: 0e2f16e47a6635920264b66fa8f7cc6093165819 [file] [log] [blame]
package volumes
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
})
}