Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
d089b5e0
Commit
d089b5e0
authored
Jun 04, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provisioning: turn relative symlinked path into absolut paths
parent
f606654c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
pkg/services/provisioning/dashboards/file_reader.go
+9
-0
No files found.
pkg/services/provisioning/dashboards/file_reader.go
View file @
d089b5e0
...
@@ -48,16 +48,25 @@ func NewDashboardFileReader(cfg *DashboardsAsConfig, log log.Logger) (*fileReade
...
@@ -48,16 +48,25 @@ func NewDashboardFileReader(cfg *DashboardsAsConfig, log log.Logger) (*fileReade
}
}
copy
:=
path
copy
:=
path
// get absolut path of config file
path
,
err
:=
filepath
.
Abs
(
path
)
path
,
err
:=
filepath
.
Abs
(
path
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error
(
"Could not create absolute path "
,
"path"
,
path
)
log
.
Error
(
"Could not create absolute path "
,
"path"
,
path
)
}
}
// follow the symlink to get the real path
path
,
err
=
filepath
.
EvalSymlinks
(
path
)
path
,
err
=
filepath
.
EvalSymlinks
(
path
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Error
(
"Failed to read content of symlinked path: %s"
,
path
)
log
.
Error
(
"Failed to read content of symlinked path: %s"
,
path
)
}
}
// get the absolut path in case the symlink is relative
path
,
err
=
filepath
.
Abs
(
path
)
if
err
!=
nil
{
log
.
Error
(
"Could not create absolute path "
,
"path"
,
path
)
}
if
path
==
""
{
if
path
==
""
{
path
=
copy
path
=
copy
log
.
Info
(
"falling back to original path due to EvalSymlink/Abs failure"
)
log
.
Info
(
"falling back to original path due to EvalSymlink/Abs failure"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment