Improve auth-enable output for plugin backends (#3189)

* Improve auth-enable output for plugin backends

* Unquote authType on final output
This commit is contained in:
Calvin Leung Huang 2017-08-16 14:31:16 -04:00 committed by GitHub
parent 406396603a
commit ea6a1382ff
2 changed files with 10 additions and 5 deletions

View file

@ -64,9 +64,14 @@ func (c *AuthEnableCommand) Run(args []string) int {
return 2
}
authTypeOutput := fmt.Sprintf("'%s'", authType)
if authType == "plugin" {
authTypeOutput = fmt.Sprintf("plugin '%s'", pluginName)
}
c.Ui.Output(fmt.Sprintf(
"Successfully enabled '%s' at '%s'!",
authType, path))
"Successfully enabled %s at '%s'!",
authTypeOutput, path))
return 0
}

View file

@ -74,14 +74,14 @@ func (c *MountCommand) Run(args []string) int {
return 2
}
mountPart := fmt.Sprintf("'%s'", mountType)
mountTypeOutput := fmt.Sprintf("'%s'", mountType)
if mountType == "plugin" {
mountPart = fmt.Sprintf("plugin '%s'", pluginName)
mountTypeOutput = fmt.Sprintf("plugin '%s'", pluginName)
}
c.Ui.Output(fmt.Sprintf(
"Successfully mounted %s at '%s'!",
mountPart, path))
mountTypeOutput, path))
return 0
}