mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
build paths in an os independent way (#29143)
Use filepath instead of path to manipulate filename paths in a way compatible with the target operating system-defined file paths.
This commit is contained in:
committed by
GitHub
parent
4f9123ebe2
commit
4430ca2317
@@ -2,7 +2,7 @@ package provisioning
|
||||
|
||||
import (
|
||||
"context"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
@@ -115,25 +115,25 @@ func (ps *provisioningServiceImpl) Run(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (ps *provisioningServiceImpl) ProvisionDatasources() error {
|
||||
datasourcePath := path.Join(ps.Cfg.ProvisioningPath, "datasources")
|
||||
datasourcePath := filepath.Join(ps.Cfg.ProvisioningPath, "datasources")
|
||||
err := ps.provisionDatasources(datasourcePath)
|
||||
return errutil.Wrap("Datasource provisioning error", err)
|
||||
}
|
||||
|
||||
func (ps *provisioningServiceImpl) ProvisionPlugins() error {
|
||||
appPath := path.Join(ps.Cfg.ProvisioningPath, "plugins")
|
||||
appPath := filepath.Join(ps.Cfg.ProvisioningPath, "plugins")
|
||||
err := ps.provisionPlugins(appPath)
|
||||
return errutil.Wrap("app provisioning error", err)
|
||||
}
|
||||
|
||||
func (ps *provisioningServiceImpl) ProvisionNotifications() error {
|
||||
alertNotificationsPath := path.Join(ps.Cfg.ProvisioningPath, "notifiers")
|
||||
alertNotificationsPath := filepath.Join(ps.Cfg.ProvisioningPath, "notifiers")
|
||||
err := ps.provisionNotifiers(alertNotificationsPath)
|
||||
return errutil.Wrap("Alert notification provisioning error", err)
|
||||
}
|
||||
|
||||
func (ps *provisioningServiceImpl) ProvisionDashboards() error {
|
||||
dashboardPath := path.Join(ps.Cfg.ProvisioningPath, "dashboards")
|
||||
dashboardPath := filepath.Join(ps.Cfg.ProvisioningPath, "dashboards")
|
||||
dashProvisioner, err := ps.newDashboardProvisioner(dashboardPath)
|
||||
if err != nil {
|
||||
return errutil.Wrap("Failed to create provisioner", err)
|
||||
|
||||
Reference in New Issue
Block a user