Fix active host implementation for start, stop, etc.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
This commit is contained in:
Nathan LeClaire 2015-02-26 19:42:57 -08:00
parent bce52e1de5
commit 27e7f54b3a
1 changed files with 10 additions and 0 deletions

View File

@ -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