1
0
mirror of https://github.com/rancher/os.git synced 2025-07-04 10:36:14 +00:00

Don't complain about cfg files not existing

Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
Sven Dowideit 2017-05-10 14:05:31 +10:00
parent cf89c124a4
commit 1e26b0b687

View File

@ -321,13 +321,15 @@ func RunInit() error {
config.MetaDataFile, config.MetaDataFile,
} }
for _, name := range filesToCopy { for _, name := range filesToCopy {
if _, err := os.Lstat(name); !os.IsNotExist(err) {
content, err := ioutil.ReadFile(name) content, err := ioutil.ReadFile(name)
if err != nil { if err != nil {
log.Error(err) log.Errorf("read cfg file (%s) %s", name, err)
continue continue
} }
configFiles[name] = content configFiles[name] = content
} }
}
return cfg, nil return cfg, nil
}}, }},
config.CfgFuncData{"switchroot", func(cfg *config.CloudConfig) (*config.CloudConfig, error) { config.CfgFuncData{"switchroot", func(cfg *config.CloudConfig) (*config.CloudConfig, error) {