-
Notifications
You must be signed in to change notification settings - Fork 921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore AcquireLocalTicket errors #955
Conversation
govc/flags/client.go
Outdated
return nil, err | ||
if u.Username() == "" && !c.IsVC() { | ||
// If no username is provided, try to acquire a local ticket. | ||
// When invoked remotely, ESX returns an InvalidRequestFault (VC returns NotSupportedFault). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this parenthetical is slightly confusing considering the conditional on line 431 excludes this path for VC.
elaborate or remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed. Thanks for reviewing Brad!
Code LGTM. Thanks for the fix! |
If no username is provided, the govc client tries to acquire a local ticket. When invoked remotely, ESX returns an InvalidRequestFault (VC returns NotSupportedFault). So, rather than return an error here, fallthrough to Login() with the original User to to avoid what would be a confusing error message. Don't try AcquireLocalTicket at all against vCenter as it is unsupported. Fixes vmware#952
// If no username is provided, try to acquire a local ticket. | ||
// When invoked remotely, ESX returns an InvalidRequestFault. | ||
// So, rather than return an error here, fallthrough to Login() with the original User to | ||
// to avoid what would be a confusing error message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so when error happens here, we login with empty user, and get something like LoginFault
, which is less confusing. Is that accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly, InvalidLoginFault with the appropriate localized message.
If no username is provided, the govc client tries to acquire a local ticket.
When invoked remotely, ESX returns an InvalidRequestFault (VC returns NotSupportedFault).
So, rather than return an error here, fallthrough to Login() with the original User to
to avoid what would be a confusing error message.
Don't try AcquireLocalTicket at all against vCenter as it is unsupported.
Fixes #952