mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 04:34:43 +02:00
Icinga DB: Replace global keys spacer '_' with ':' to fit new schema
This commit is contained in:
parent
a8f98cf721
commit
fb89c88ca9
@ -155,9 +155,9 @@ void IcingaDB::UpdateAllConfigObjects()
|
|||||||
|
|
||||||
const std::vector<String> globalKeys = {
|
const std::vector<String> globalKeys = {
|
||||||
m_PrefixConfigObject + "customvar",
|
m_PrefixConfigObject + "customvar",
|
||||||
m_PrefixConfigObject + "action_url",
|
m_PrefixConfigObject + "action:url",
|
||||||
m_PrefixConfigObject + "notes_url",
|
m_PrefixConfigObject + "notes:url",
|
||||||
m_PrefixConfigObject + "icon_image",
|
m_PrefixConfigObject + "icon:image",
|
||||||
};
|
};
|
||||||
DeleteKeys(globalKeys, Prio::Config);
|
DeleteKeys(globalKeys, Prio::Config);
|
||||||
DeleteKeys({"icinga:nextupdate:host", "icinga:nextupdate:service"}, Prio::CheckResult);
|
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 notesUrl = checkable->GetNotesUrl();
|
||||||
String iconImage = checkable->GetIconImage();
|
String iconImage = checkable->GetIconImage();
|
||||||
if (!actionUrl.IsEmpty()) {
|
if (!actionUrl.IsEmpty()) {
|
||||||
auto& actionUrls (hMSets[m_PrefixConfigObject + "action_url"]);
|
auto& actionUrls (hMSets[m_PrefixConfigObject + "action:url"]);
|
||||||
|
|
||||||
auto id (HashValue(new Array({env, actionUrl})));
|
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));
|
actionUrls.emplace_back(JsonEncode(data));
|
||||||
|
|
||||||
if (runtimeUpdate) {
|
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()) {
|
if (!notesUrl.IsEmpty()) {
|
||||||
auto& notesUrls (hMSets[m_PrefixConfigObject + "notes_url"]);
|
auto& notesUrls (hMSets[m_PrefixConfigObject + "notes:url"]);
|
||||||
|
|
||||||
auto id (HashValue(new Array({env, notesUrl})));
|
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));
|
notesUrls.emplace_back(JsonEncode(data));
|
||||||
|
|
||||||
if (runtimeUpdate) {
|
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()) {
|
if (!iconImage.IsEmpty()) {
|
||||||
auto& iconImages (hMSets[m_PrefixConfigObject + "icon_image"]);
|
auto& iconImages (hMSets[m_PrefixConfigObject + "icon:image"]);
|
||||||
|
|
||||||
auto id (HashValue(new Array({env, iconImage})));
|
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));
|
iconImages.emplace_back(JsonEncode(data));
|
||||||
|
|
||||||
if (runtimeUpdate) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user