From ea6a1382ff59c0549e075831faf6113bd3d0dfe4 Mon Sep 17 00:00:00 2001 From: Calvin Leung Huang Date: Wed, 16 Aug 2017 14:31:16 -0400 Subject: [PATCH] Improve auth-enable output for plugin backends (#3189) * Improve auth-enable output for plugin backends * Unquote authType on final output --- command/auth_enable.go | 9 +++++++-- command/mount.go | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/command/auth_enable.go b/command/auth_enable.go index 7cf69c394..2c72a0464 100644 --- a/command/auth_enable.go +++ b/command/auth_enable.go @@ -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 } diff --git a/command/mount.go b/command/mount.go index c29d13e24..c918a864e 100644 --- a/command/mount.go +++ b/command/mount.go @@ -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 }