mirror of https://github.com/Icinga/icinga2.git
Merge pull request #8725 from Icinga/bugfix/icingadb-serialize-leaves
Icinga DB: serialize icinga:config:checkcommand:argument#value and #set_if as expected
This commit is contained in:
commit
00af435c13
|
@ -978,12 +978,20 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S
|
|||
values = new Dictionary({{"value", kv.second}});
|
||||
}
|
||||
|
||||
{
|
||||
for (const char *attr : {"value", "set_if"}) {
|
||||
Value value;
|
||||
|
||||
// JsonEncode() the value if it's set.
|
||||
if (values->Get("value", &value)) {
|
||||
values->Set("value", JsonEncode(value));
|
||||
// Stringify if set.
|
||||
if (values->Get(attr, &value)) {
|
||||
switch (value.GetType()) {
|
||||
case ValueString:
|
||||
break;
|
||||
case ValueObject:
|
||||
values->Set(attr, value.Get<Object::Ptr>()->ToString());
|
||||
break;
|
||||
default:
|
||||
values->Set(attr, JsonEncode(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue