1
0
mirror of https://github.com/rancher/os.git synced 2025-09-15 22:49:08 +00:00

Warn when attempting to switch to the same console

This commit is contained in:
Josh Curl
2016-06-16 09:52:02 -07:00
parent d797d587ab
commit a9e34206bc

View File

@@ -48,6 +48,11 @@ func consoleSwitch(c *cli.Context) error {
}
newConsole := c.Args()[0]
cfg := config.LoadConfig()
if newConsole == cfg.Rancher.Console {
log.Warnf("Console is already set to %s", newConsole)
}
if !c.Bool("force") {
in := bufio.NewReader(os.Stdin)
fmt.Println("Switching consoles will destroy the current console container and restart Docker.")
@@ -57,8 +62,6 @@ func consoleSwitch(c *cli.Context) error {
}
}
cfg := config.LoadConfig()
if newConsole != "default" {
if err := compose.StageServices(cfg, newConsole); err != nil {
return err