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.
This commit is contained in:
Alexander A. Klimov 2023-05-24 16:04:14 +02:00
parent 3276cc9412
commit ad618e9716
1 changed files with 9 additions and 0 deletions

View File

@ -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;