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