fixes error when running config against no active host

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
This commit is contained in:
Evan Hazlett 2015-02-04 11:28:49 -05:00
parent 4a81c4b17f
commit 7ce53190cf
No known key found for this signature in database
GPG Key ID: A519480096146526
1 changed files with 6 additions and 0 deletions

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