Missed initializing another field in Template!

This commit is contained in:
Michael Schurter 2017-02-24 10:47:50 -08:00
parent 531af8f932
commit 6011a74ab9
1 changed files with 7 additions and 4 deletions

View File

@ -334,10 +334,13 @@ func (tmpl *Template) Canonicalize() {
if tmpl.ChangeMode == nil {
tmpl.ChangeMode = helper.StringToPtr("restart")
}
if *tmpl.ChangeMode == "signal" && tmpl.ChangeSignal == nil {
tmpl.ChangeSignal = helper.StringToPtr("SIGHUP")
}
if tmpl.ChangeSignal != nil {
if tmpl.ChangeSignal == nil {
if *tmpl.ChangeMode == "signal" {
tmpl.ChangeSignal = helper.StringToPtr("SIGHUP")
} else {
tmpl.ChangeSignal = helper.StringToPtr("")
}
} else {
sig := *tmpl.ChangeSignal
tmpl.ChangeSignal = helper.StringToPtr(strings.ToUpper(sig))
}