1
0
mirror of https://github.com/rancher/os.git synced 2025-07-05 11:06:13 +00:00

Merge pull request #1019 from joshwget/console-switch-warning

Warn when attempting to switch to the same console
This commit is contained in:
Darren Shepherd 2016-06-16 11:11:11 -07:00 committed by GitHub
commit 21fce533b8

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