Icinga DB: ensure icinga:*command:argument#order is an int

The config parser requires *Command#arguments#order to be a Number, i.e. 42,
4.2 or even "4.2". That's int-casted where needed, now also for Icinga DB.

Before:

```
object CheckCommand "9117" {
	command = [ "true" ]
	arguments = {
		"4.2" = { order = "4.2" }
	}
}
```

2022-01-03T13:25:07.166+0100	FATAL	icingadb	json: cannot unmarshal string into Go value of type int64
This commit is contained in:
Alexander A. Klimov 2022-01-03 13:28:19 +01:00
parent d6a1757cb8
commit a8c9d19dae
1 changed files with 9 additions and 0 deletions

View File

@ -1009,6 +1009,15 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S
}
}
{
Value order;
// Intify if set.
if (values->Get("order", &order)) {
values->Set("order", (int)order);
}
}
values->Set(objectKeyName, objectKey);
values->Set("argument_key", kv.first);
values->Set("environment_id", m_EnvironmentId);