Make Python compatability a flag

This commit is contained in:
Ian Fijolek
2020-02-19 17:31:04 -08:00
parent 8f93997b80
commit a39c188a6c
5 changed files with 42 additions and 17 deletions
+8 -7
View File
@@ -118,14 +118,15 @@ func LoadConfig(filePath string) (config Config, err error) {
log.Printf("DEBUG: Config values:\n%v\n", config)
}
// Intialize alerts list if not present
if config.Alerts == nil {
config.Alerts = map[string]*Alert{}
}
// Add log alert if not present
if _, ok := config.Alerts["log"]; !ok {
config.Alerts["log"] = NewLogAlert()
if PyCompat {
// Intialize alerts list if not present
if config.Alerts == nil {
config.Alerts = map[string]*Alert{}
}
if _, ok := config.Alerts["log"]; !ok {
config.Alerts["log"] = NewLogAlert()
}
}
if !config.IsValid() {