Skip to content

Commit

Permalink
Icinga DB feature: normalize *Command.arguments[*].{required,skip_key…
Browse files Browse the repository at this point in the history
…,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.
  • Loading branch information
Al2Klimov committed May 24, 2023
1 parent 3276cc9 commit ad618e9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/icingadb/icingadb-objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ad618e9

Please sign in to comment.