1
0
mirror of https://github.com/rancher/os.git synced 2025-07-04 02:26:13 +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,12 +321,14 @@ func RunInit() error {
config.MetaDataFile, config.MetaDataFile,
} }
for _, name := range filesToCopy { for _, name := range filesToCopy {
content, err := ioutil.ReadFile(name) if _, err := os.Lstat(name); !os.IsNotExist(err) {
if err != nil { content, err := ioutil.ReadFile(name)
log.Error(err) if err != nil {
continue log.Errorf("read cfg file (%s) %s", name, err)
continue
}
configFiles[name] = content
} }
configFiles[name] = content
} }
return cfg, nil return cfg, nil
}}, }},