From d3ae05039f3b9ee1ba09ca0646dc065035a263bb Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Tue, 8 Oct 2019 16:54:21 +0200 Subject: [PATCH] *comment: Fix EntryType not using enum types --- configobject/objecttypes/host/hostcomment/hostcomment.go | 3 ++- .../objecttypes/service/servicecomment/servicecomment.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configobject/objecttypes/host/hostcomment/hostcomment.go b/configobject/objecttypes/host/hostcomment/hostcomment.go index 5096312a..70cec212 100644 --- a/configobject/objecttypes/host/hostcomment/hostcomment.go +++ b/configobject/objecttypes/host/hostcomment/hostcomment.go @@ -1,6 +1,7 @@ package hostcomment import ( + "fmt" "git.icinga.com/icingadb/icingadb-main/configobject" "git.icinga.com/icingadb/icingadb-main/connection" "git.icinga.com/icingadb/icingadb-main/utils" @@ -65,7 +66,7 @@ func (h *HostComment) UpdateValues() []interface{} { h.Name, h.Author, h.Text, - h.EntryType, + utils.CommentEntryTypes[fmt.Sprintf("%.0f", h.EntryType)], h.EntryTime, utils.Bool[h.IsPersistent], h.ExpireTime, diff --git a/configobject/objecttypes/service/servicecomment/servicecomment.go b/configobject/objecttypes/service/servicecomment/servicecomment.go index 09c798e6..66fdcdb7 100644 --- a/configobject/objecttypes/service/servicecomment/servicecomment.go +++ b/configobject/objecttypes/service/servicecomment/servicecomment.go @@ -1,6 +1,7 @@ package servicecomment import ( + "fmt" "git.icinga.com/icingadb/icingadb-main/configobject" "git.icinga.com/icingadb/icingadb-main/connection" "git.icinga.com/icingadb/icingadb-main/utils" @@ -65,7 +66,7 @@ func (s *ServiceComment) UpdateValues() []interface{} { s.Name, s.Author, s.Text, - s.EntryType, + utils.CommentEntryTypes[fmt.Sprintf("%.0f", s.EntryType)], s.EntryTime, utils.Bool[s.IsPersistent], s.ExpireTime,