Commit f606654c by bergquist

provisioning: adds fallback if evalsymlink/abs fails

parent 3f507833
......@@ -51,7 +51,6 @@ func NewDashboardFileReader(cfg *DashboardsAsConfig, log log.Logger) (*fileReade
path, err := filepath.Abs(path)
if err != nil {
log.Error("Could not create absolute path ", "path", path)
path = copy //if .Abs return an error we fallback to path
}
path, err = filepath.EvalSymlinks(path)
......@@ -59,6 +58,11 @@ func NewDashboardFileReader(cfg *DashboardsAsConfig, log log.Logger) (*fileReade
log.Error("Failed to read content of symlinked path: %s", path)
}
if path == "" {
path = copy
log.Info("falling back to original path due to EvalSymlink/Abs failure")
}
return &fileReader{
Cfg: cfg,
Path: path,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment