Properly return error when invalid instance state is found

This commit is contained in:
Pierre Riteau 2014-04-08 19:26:09 +01:00
parent 7e970a8c08
commit 77dedd9eab
1 changed files with 1 additions and 2 deletions

View File

@ -75,8 +75,7 @@ func WaitForState(conf *StateChangeConf) (i interface{}, err error) {
}
if !found {
fmt.Errorf("unexpected state '%s', wanted target '%s'", currentState, conf.Target)
return
return nil, fmt.Errorf("unexpected state '%s', wanted target '%s'", currentState, conf.Target)
}
log.Printf("Waiting for state to become: %s currently %s (%d%%)", conf.Target, currentState, currentProgress)