Skip to content

Commit

Permalink
Improve next action suggestion in mc admin config set (#2810)
Browse files Browse the repository at this point in the history
  • Loading branch information
krisis authored and kannappanr committed Jun 27, 2019
1 parent 56309a4 commit 8b33b28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/admin-config-set.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package cmd

import (
"fmt"
"os"

"github.com/fatih/color"
Expand Down Expand Up @@ -51,6 +52,7 @@ EXAMPLES:
type configSetMessage struct {
Status string `json:"status"`
setConfigStatus bool
targetAlias string
}

// String colorized service status message.
Expand All @@ -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")
Expand Down Expand Up @@ -112,6 +115,7 @@ func mainAdminConfigSet(ctx *cli.Context) error {
// Print set config result
printMsg(configSetMessage{
setConfigStatus: true,
targetAlias: aliasedURL,
})

return nil
Expand Down

0 comments on commit 8b33b28

Please sign in to comment.