Adding error check when read instance id failed

pull/6/head
dagnello 2016-05-13 22:18:55 -07:00
parent 9796900306
commit 52811375d1
1 changed files with 3 additions and 0 deletions

View File

@ -94,6 +94,9 @@ func readInstanceID(cfg *VSphereConfig) (string, error) {
if err != nil {
return "", err
}
if out.Len() == 0 {
return "", fmt.Errorf("unable to retrieve Instance ID")
}
// Create context
ctx, cancel := context.WithCancel(context.Background())