command/logout: Exit early if already logged out
This commit is contained in:
parent
081f02971d
commit
325f8a84f8
|
@ -95,9 +95,12 @@ func (c *LogoutCommand) Run(args []string) int {
|
||||||
// in a test, but it should always be set in normal use.
|
// in a test, but it should always be set in normal use.
|
||||||
if credsCtx != nil {
|
if credsCtx != nil {
|
||||||
switch credsCtx.Location {
|
switch credsCtx.Location {
|
||||||
|
case cliconfig.CredentialsNotAvailable:
|
||||||
|
c.Ui.Output(fmt.Sprintf("No credentials for %s are stored.\n", dispHostname))
|
||||||
|
return 0
|
||||||
case cliconfig.CredentialsViaHelper:
|
case cliconfig.CredentialsViaHelper:
|
||||||
c.Ui.Output(fmt.Sprintf("Removing the stored credentials for %s from the configured\n%q credentials helper.\n", dispHostname, credsCtx.HelperType))
|
c.Ui.Output(fmt.Sprintf("Removing the stored credentials for %s from the configured\n%q credentials helper.\n", dispHostname, credsCtx.HelperType))
|
||||||
case cliconfig.CredentialsInPrimaryFile, cliconfig.CredentialsNotAvailable:
|
case cliconfig.CredentialsInPrimaryFile:
|
||||||
c.Ui.Output(fmt.Sprintf("Removing the stored credentials for %s from the following file:\n %s\n", dispHostname, credsCtx.LocalFilename))
|
c.Ui.Output(fmt.Sprintf("Removing the stored credentials for %s from the following file:\n %s\n", dispHostname, credsCtx.LocalFilename))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue