provisioning: enable relative path's

this commit enable relatives path for provisioning dashboards.
this enables easier dev setups
This commit is contained in:
bergquist
2018-05-30 08:46:44 +02:00
parent b253284acc
commit c7acbcdaf5
3 changed files with 55 additions and 30 deletions
@@ -47,9 +47,15 @@ func NewDashboardFileReader(cfg *DashboardsAsConfig, log log.Logger) (*fileReade
log.Error("Cannot read directory", "error", err)
}
absPath, err := filepath.Abs(path)
if err != nil {
log.Error("Could not create absolute path ", "path", path)
absPath = path //if .Abs return an error we fallback to path
}
return &fileReader{
Cfg: cfg,
Path: path,
Path: absPath,
log: log,
dashboardService: dashboards.NewProvisioningService(),
}, nil