From 99350e6b274c105baf34a92eb77e14e497c05fe7 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 24 May 2023 16:04:14 +0200 Subject: [PATCH] Icinga DB feature: normalize *Command.arguments[*].{required,skip_key,repeat_key} to boolean At the moment, the Icinga DB feature will use that value as-is and serialize it to JSON, resulting in a crash in Icinga DB down the road because it expects a boolean. --- lib/icingadb/icingadb-objects.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index ac1469ba5..15fb1888a 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -1019,6 +1019,15 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S } } + for (const char *attr : {"repeat_key", "required", "skip_key"}) { + Value value; + + // Boolify if set. + if (values->Get(attr, &value)) { + values->Set(attr, value.ToBool()); + } + } + { Value order;