Skip to content

Commit

Permalink
Applying changes per PR feedback -
Browse files Browse the repository at this point in the history
Check for error conditions from the vSphere API and return the err if one occurs. The vSphere API does not return an err for unauthenticated users, it just returns a nil user object.
  • Loading branch information
Robert Roland authored and Ritesh H Shukla committed Jan 11, 2017
1 parent e57dea8 commit fc1d0bb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/cloudprovider/providers/vsphere/vsphere.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,11 @@ func vSphereLogin(vs *VSphere, ctx context.Context) error {
m := session.NewManager(vs.client.Client)
// retrieve client's current session
u, err := m.UserSession(ctx)
if err == nil && u != nil {
// current session is valid
if err != nil {
glog.Errorf("Error while obtaining user session. err: %q", err)
return err
}
if u != nil {
return nil
}

Expand Down

0 comments on commit fc1d0bb

Please sign in to comment.