Improve next action suggestion in mc admin config set (#2810)

This commit is contained in:
Krishnan Parthasarathi
2019-06-27 12:15:21 -07:00
committed by kannappanr
parent 56309a4999
commit 8b33b2809c
+5 -1
View File
@@ -17,6 +17,7 @@
package cmd
import (
"fmt"
"os"
"github.com/fatih/color"
@@ -51,6 +52,7 @@ EXAMPLES:
type configSetMessage struct {
Status string `json:"status"`
setConfigStatus bool
targetAlias string
}
// String colorized service status message.
@@ -59,8 +61,9 @@ func (u configSetMessage) String() (msg string) {
if u.setConfigStatus {
msg += console.Colorize("SetConfigSuccess",
"Setting new MinIO configuration file has been successful.\n")
suggestion := fmt.Sprintf("mc admin service restart %s", u.targetAlias)
msg += console.Colorize("SetConfigSuccess",
"Please restart your server with `mc admin service restart`.\n")
fmt.Sprintf("Please restart your server with `%s`.\n", suggestion))
} else {
msg += console.Colorize("SetConfigFailure",
"Setting new MinIO configuration file has failed.\n")
@@ -112,6 +115,7 @@ func mainAdminConfigSet(ctx *cli.Context) error {
// Print set config result
printMsg(configSetMessage{
setConfigStatus: true,
targetAlias: aliasedURL,
})
return nil