1
0
mirror of https://github.com/rancher/os.git synced 2025-09-01 14:48:55 +00:00

Fix boot issues due to invalid configs

This commit is contained in:
Josh Curl
2016-06-01 18:41:55 -07:00
parent 97344cc535
commit 08f40ad3e7
14 changed files with 124 additions and 186 deletions

View File

@@ -96,11 +96,7 @@ func saveFiles(cloudConfigBytes, scriptBytes []byte, metadata datasource.Metadat
}
func currentDatasource() (datasource.Datasource, error) {
cfg, err := rancherConfig.LoadConfig()
if err != nil {
log.WithFields(log.Fields{"err": err}).Error("Failed to read rancher config")
return nil, err
}
cfg := rancherConfig.LoadConfig()
dss := getDatasources(cfg)
if len(dss) == 0 {
@@ -169,10 +165,7 @@ func fetchUserData() ([]byte, datasource.Metadata, error) {
}
func executeCloudConfig() error {
cc, err := rancherConfig.LoadConfig()
if err != nil {
return err
}
cc := rancherConfig.LoadConfig()
if len(cc.SSHAuthorizedKeys) > 0 {
authorizeSSHKeys("rancher", cc.SSHAuthorizedKeys, sshKeyName)