mirror of https://github.com/Icinga/icinga2.git
IcingaDB: handle null (Empty) for value/set_if/separator in command arguments
Icinga 2 treats null (Empty) as if the corresponding attribute is not specified. However, without this commit, it would serialize the value as "null" (i.e. type string), so that it ends up in the database as this string instead of NULL. This commit adds handling for ValueEmpty so that is serialized as JSON null value and ends up in the database as NULL.
This commit is contained in:
parent
f46d474e2f
commit
f110e26635
|
@ -996,6 +996,7 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S
|
||||||
// Stringify if set.
|
// Stringify if set.
|
||||||
if (values->Get(attr, &value)) {
|
if (values->Get(attr, &value)) {
|
||||||
switch (value.GetType()) {
|
switch (value.GetType()) {
|
||||||
|
case ValueEmpty:
|
||||||
case ValueString:
|
case ValueString:
|
||||||
break;
|
break;
|
||||||
case ValueObject:
|
case ValueObject:
|
||||||
|
|
Loading…
Reference in New Issue