mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 07:04:37 +02:00
Stringify flat values
This commit is contained in:
parent
d0a45521a9
commit
315e9ffad8
@ -30,6 +30,7 @@
|
|||||||
#include "base/objectlock.hpp"
|
#include "base/objectlock.hpp"
|
||||||
#include "base/array.hpp"
|
#include "base/array.hpp"
|
||||||
#include "base/scriptglobal.hpp"
|
#include "base/scriptglobal.hpp"
|
||||||
|
#include "base/convert.hpp"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -253,9 +254,13 @@ Dictionary::Ptr RedisWriter::SerializeVars(const CustomVarObject::Ptr& object)
|
|||||||
auto it (scalarVars.find(kv.first));
|
auto it (scalarVars.find(kv.first));
|
||||||
if (it != scalarVars.end()) {
|
if (it != scalarVars.end()) {
|
||||||
for (auto& scalarVar : it->second) {
|
for (auto& scalarVar : it->second) {
|
||||||
|
String strVal = Convert::ToString(scalarVar.second);
|
||||||
|
if (scalarVar.second.GetType() == ValueEmpty)
|
||||||
|
strVal = "NULL";
|
||||||
|
|
||||||
flatVars->Set(SHA1(PackObject(scalarVar.first)), (Dictionary::Ptr)new Dictionary({
|
flatVars->Set(SHA1(PackObject(scalarVar.first)), (Dictionary::Ptr)new Dictionary({
|
||||||
{"name", scalarVar.first},
|
{"name", scalarVar.first},
|
||||||
{"value", scalarVar.second}
|
{"value", strVal}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user