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
6d1ec19f
Commit
6d1ec19f
authored
Dec 05, 2018
by
Pavel Bakulev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed validation funcs for alert notification
parent
7b09dd38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
pkg/services/provisioning/alert_notifications/config_reader.go
+4
-8
No files found.
pkg/services/provisioning/alert_notifications/config_reader.go
View file @
6d1ec19f
...
@@ -41,12 +41,9 @@ func (cr *configReader) readConfig(path string) ([]*notificationsAsConfig, error
...
@@ -41,12 +41,9 @@ func (cr *configReader) readConfig(path string) ([]*notificationsAsConfig, error
}
}
cr
.
log
.
Debug
(
"Validating alert notifications"
)
cr
.
log
.
Debug
(
"Validating alert notifications"
)
err
=
validateDefaultUniqueness
(
notifications
)
validateOrgIdAndSet
(
notifications
)
if
err
!=
nil
{
return
nil
,
err
}
err
=
validate
Type
(
notifications
)
err
=
validate
Notifications
(
notifications
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -70,7 +67,7 @@ func (cr *configReader) parseNotificationConfig(path string, file os.FileInfo) (
...
@@ -70,7 +67,7 @@ func (cr *configReader) parseNotificationConfig(path string, file os.FileInfo) (
return
cfg
.
mapToNotificationFromConfig
(),
nil
return
cfg
.
mapToNotificationFromConfig
(),
nil
}
}
func
validate
DefaultUniqueness
(
notifications
[]
*
notificationsAsConfig
)
error
{
func
validate
OrgIdAndSet
(
notifications
[]
*
notificationsAsConfig
)
{
for
i
:=
range
notifications
{
for
i
:=
range
notifications
{
for
_
,
notification
:=
range
notifications
[
i
]
.
Notifications
{
for
_
,
notification
:=
range
notifications
[
i
]
.
Notifications
{
if
notification
.
OrgId
<
1
{
if
notification
.
OrgId
<
1
{
...
@@ -93,10 +90,9 @@ func validateDefaultUniqueness(notifications []*notificationsAsConfig) error {
...
@@ -93,10 +90,9 @@ func validateDefaultUniqueness(notifications []*notificationsAsConfig) error {
}
}
}
}
return
nil
}
}
func
validate
Type
(
notifications
[]
*
notificationsAsConfig
)
error
{
func
validate
Notifications
(
notifications
[]
*
notificationsAsConfig
)
error
{
notifierTypes
:=
alerting
.
GetNotifiers
()
notifierTypes
:=
alerting
.
GetNotifiers
()
for
i
:=
range
notifications
{
for
i
:=
range
notifications
{
...
...
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