Merge pull request #487 from ehazlett/fix-config-no-machine

fixes error when running config against no active host
This commit is contained in:
Evan Hazlett
2015-02-04 11:30:54 -05:00

View File

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