From 27e7f54b3aa5061d2def68ad5965f6acdbb8725c Mon Sep 17 00:00:00 2001 From: Nathan LeClaire Date: Thu, 26 Feb 2015 19:42:57 -0800 Subject: [PATCH] Fix active host implementation for start, stop, etc. Signed-off-by: Nathan LeClaire --- commands.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/commands.go b/commands.go index d9b6687d02..9d95d05ca3 100644 --- a/commands.go +++ b/commands.go @@ -630,6 +630,16 @@ func runActionWithContext(actionName string, c *cli.Context) error { return err } + // No args specified, so use active. + if len(machines) == 0 { + store := NewStore(utils.GetMachineDir(), c.GlobalString("tls-ca-cert"), c.GlobalString("tls-ca-key")) + activeHost, err := store.GetActive() + if err != nil { + log.Fatalf("Unable to get active host: %v", err) + } + machines = []*Host{activeHost} + } + runActionForeachMachine(actionName, machines) return nil