improve some messages in the node subcmds

Signed-off-by: Victor Vieux <vieux@docker.com>
This commit is contained in:
Victor Vieux 2016-06-16 16:39:27 -07:00
parent eb6cc31802
commit eb962235fb
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
}