mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-28 08:04:14 +02:00
Icinga DB: also write ConfigObject#original_attributes into Redis
for the case the Go daemon decides to sync them into DB.
This commit is contained in:
parent
a3dabde28a
commit
385fe2fd76
@ -1232,9 +1232,16 @@ void IcingaDB::AddObjectDataToRuntimeUpdates(std::vector<Dictionary::Ptr>& runti
|
|||||||
// for IcingaDB.
|
// for IcingaDB.
|
||||||
bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& attributes, Dictionary::Ptr& checksums)
|
bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& attributes, Dictionary::Ptr& checksums)
|
||||||
{
|
{
|
||||||
|
auto originalAttrs (object->GetOriginalAttributes());
|
||||||
|
|
||||||
|
if (originalAttrs) {
|
||||||
|
originalAttrs = originalAttrs->ShallowClone();
|
||||||
|
}
|
||||||
|
|
||||||
attributes->Set("name_checksum", SHA1(object->GetName()));
|
attributes->Set("name_checksum", SHA1(object->GetName()));
|
||||||
attributes->Set("environment_id", m_EnvironmentId);
|
attributes->Set("environment_id", m_EnvironmentId);
|
||||||
attributes->Set("name", object->GetName());
|
attributes->Set("name", object->GetName());
|
||||||
|
attributes->Set("original_attributes", originalAttrs);
|
||||||
|
|
||||||
Zone::Ptr ObjectsZone;
|
Zone::Ptr ObjectsZone;
|
||||||
Type::Ptr type = object->GetReflectionType();
|
Type::Ptr type = object->GetReflectionType();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user