1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #23647 from vieux/improve_messages_node_cmds

improve some messages in the node subcmds
This commit is contained in:
Arnaud Porterie 2016-06-17 03:20:30 +00:00 committed by GitHub
commit 4c5f1a7e5b
4 changed files with 8 additions and 5 deletions

View file

@ -33,7 +33,7 @@ func runAccept(dockerCli *client.DockerCli, flags *pflag.FlagSet, args []string)
}); err != nil {
return err
}
fmt.Println(id, "attempting to accept a node in the swarm.")
fmt.Fprintf(dockerCli.Out(), "Node %s accepted in the swarm.", id)
}
return nil

View file

@ -33,7 +33,7 @@ func runDemote(dockerCli *client.DockerCli, flags *pflag.FlagSet, args []string)
}); err != nil {
return err
}
fmt.Println(id, "attempting to demote a manager in the swarm.")
fmt.Fprintf(dockerCli.Out(), "Manager %s demoted in the swarm.", id)
}
return nil

View file

@ -33,7 +33,7 @@ func runPromote(dockerCli *client.DockerCli, flags *pflag.FlagSet, args []string
}); err != nil {
return err
}
fmt.Println(id, "attempting to promote a node to a manager in the swarm.")
fmt.Fprintf(dockerCli.Out(), "Node %s promoted to a manager in the swarm.", id)
}
return nil

View file

@ -21,7 +21,11 @@ func newUpdateCommand(dockerCli *client.DockerCli) *cobra.Command {
Short: "Update a node",
Args: cli.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return runUpdate(dockerCli, args[0], mergeNodeUpdate(flags))
if err := runUpdate(dockerCli, args[0], mergeNodeUpdate(flags)); err != nil {
return err
}
fmt.Fprintln(dockerCli.Out(), args[0])
return nil
},
}
@ -47,7 +51,6 @@ func runUpdate(dockerCli *client.DockerCli, nodeID string, mergeNode func(node *
return err
}
fmt.Fprintf(dockerCli.Out(), "%s\n", nodeID)
return nil
}