diff --git a/commands.go b/commands.go index fa6fa2f7a4..d58d2e0e10 100644 --- a/commands.go +++ b/commands.go @@ -540,15 +540,21 @@ func getMachineConfig(c *cli.Context) (*machineConfig, error) { if err != nil { log.Fatalf("error getting active host: %v", err) } + if m == nil { + return nil, fmt.Errorf("There is no active host") + } machine = m } else { m, err := store.Load(name) + fmt.Println(err) if err != nil { return nil, fmt.Errorf("Error loading machine config: %s", err) } machine = m } + fmt.Println(machine) + caCert := filepath.Join(utils.GetMachineClientCertDir(), "ca.pem") clientCert := filepath.Join(utils.GetMachineClientCertDir(), "cert.pem") clientKey := filepath.Join(utils.GetMachineClientCertDir(), "key.pem")