From fb89c88ca907f957539ae73516c78aea02f0583b Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Tue, 18 May 2021 08:58:52 +0200 Subject: [PATCH] Icinga DB: Replace global keys spacer '_' with ':' to fit new schema --- lib/icingadb/icingadb-objects.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index 86cdd2744..8cbf17ae6 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -155,9 +155,9 @@ void IcingaDB::UpdateAllConfigObjects() const std::vector globalKeys = { m_PrefixConfigObject + "customvar", - m_PrefixConfigObject + "action_url", - m_PrefixConfigObject + "notes_url", - m_PrefixConfigObject + "icon_image", + m_PrefixConfigObject + "action:url", + m_PrefixConfigObject + "notes:url", + m_PrefixConfigObject + "icon:image", }; DeleteKeys(globalKeys, Prio::Config); DeleteKeys({"icinga:nextupdate:host", "icinga:nextupdate:service"}, Prio::CheckResult); @@ -643,7 +643,7 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S String notesUrl = checkable->GetNotesUrl(); String iconImage = checkable->GetIconImage(); if (!actionUrl.IsEmpty()) { - auto& actionUrls (hMSets[m_PrefixConfigObject + "action_url"]); + auto& actionUrls (hMSets[m_PrefixConfigObject + "action:url"]); auto id (HashValue(new Array({env, actionUrl}))); @@ -653,12 +653,12 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S actionUrls.emplace_back(JsonEncode(data)); if (runtimeUpdate) { - AddObjectDataToRuntimeUpdates(runtimeUpdates, actionUrls.at(actionUrls.size() - 2u), m_PrefixConfigObject + "action_url", data); + AddObjectDataToRuntimeUpdates(runtimeUpdates, actionUrls.at(actionUrls.size() - 2u), m_PrefixConfigObject + "action:url", data); } } } if (!notesUrl.IsEmpty()) { - auto& notesUrls (hMSets[m_PrefixConfigObject + "notes_url"]); + auto& notesUrls (hMSets[m_PrefixConfigObject + "notes:url"]); auto id (HashValue(new Array({env, notesUrl}))); @@ -668,12 +668,12 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S notesUrls.emplace_back(JsonEncode(data)); if (runtimeUpdate) { - AddObjectDataToRuntimeUpdates(runtimeUpdates, notesUrls.at(notesUrls.size() - 2u), m_PrefixConfigObject + "notes_url", data); + AddObjectDataToRuntimeUpdates(runtimeUpdates, notesUrls.at(notesUrls.size() - 2u), m_PrefixConfigObject + "notes:url", data); } } } if (!iconImage.IsEmpty()) { - auto& iconImages (hMSets[m_PrefixConfigObject + "icon_image"]); + auto& iconImages (hMSets[m_PrefixConfigObject + "icon:image"]); auto id (HashValue(new Array({env, iconImage}))); @@ -683,7 +683,7 @@ void IcingaDB::InsertObjectDependencies(const ConfigObject::Ptr& object, const S iconImages.emplace_back(JsonEncode(data)); if (runtimeUpdate) { - AddObjectDataToRuntimeUpdates(runtimeUpdates, iconImages.at(iconImages.size() - 2u), m_PrefixConfigObject + "icon_image", data); + AddObjectDataToRuntimeUpdates(runtimeUpdates, iconImages.at(iconImages.size() - 2u), m_PrefixConfigObject + "icon:image", data); } } }