Adding error check when read instance id failed

This commit is contained in:
dagnello
2016-05-13 22:18:55 -07:00
parent 9796900306
commit 52811375d1

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())