mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-13 00:24:36 +08:00
BUG: Fix --notify on preview and on error (#3616)
This commit is contained in:
parent
d042b3edf7
commit
919ce24769
1 changed files with 12 additions and 12 deletions
|
@ -516,25 +516,25 @@ func pprintOrRunCorrections(zoneName string, providerName string, corrections []
|
||||||
cc++
|
cc++
|
||||||
}
|
}
|
||||||
|
|
||||||
var err error
|
// If interactive, ask "are you sure?" and skip if not.
|
||||||
if push {
|
if push && interactive && !out.PromptToRun() {
|
||||||
// If interactive, ask "are you sure?" and skip if not.
|
continue
|
||||||
if interactive && !out.PromptToRun() {
|
}
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// If it is an action (not an informational message), notify and execute.
|
// If it is an action (not an informational message), notify and execute.
|
||||||
if correction.F != nil {
|
if correction.F != nil {
|
||||||
err = notifier.Notify(zoneName, providerName, correction.Msg, err, false)
|
var err error
|
||||||
if err != nil {
|
if push {
|
||||||
out.Printf("Error sending notification: %s\n", err)
|
|
||||||
}
|
|
||||||
err = correction.F()
|
err = correction.F()
|
||||||
out.EndCorrection(err)
|
out.EndCorrection(err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
anyErrors = true
|
anyErrors = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
notifyErr := notifier.Notify(zoneName, providerName, correction.Msg, err, !push)
|
||||||
|
if notifyErr != nil {
|
||||||
|
out.Warnf("Error sending notification: %s\n", notifyErr)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue