Ensure that type names are lower cases for Redis lookups

This commit is contained in:
Michael Friedrich 2018-05-29 12:54:44 +02:00
parent 33a00e4b5a
commit 8c38c7eddc
1 changed files with 6 additions and 3 deletions

View File

@ -120,7 +120,7 @@ void RedisWriter::UpdateAllConfigObjects(void)
if (!ctype)
continue;
String typeName = type->GetName();
String typeName = type->GetName().ToLower();
/* replace into aka delete insert is faster than a full diff */
ExecuteQuery({ "DEL", "icinga:config:" + typeName, "icinga:config:" + typeName + ":checksum", "icinga:status:" + typeName });
@ -157,6 +157,10 @@ void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, bool useTran
UpdateObjectAttrs("icinga:config:", object, FAConfig);
Type::Ptr type = object->GetReflectionType();
String typeName = type->GetName().ToLower();
// /* Serialize config object attributes */
// Dictionary::Ptr objectAttrs = SerializeObjectAttrs(object, FAConfig);
//
@ -199,7 +203,6 @@ void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, bool useTran
// ExecuteQuery({ "HSET", "icinga:config:" + typeName + ":checksum", objectName, checkSumBody });
if (runtimeUpdate) {
Type::Ptr type = object->GetReflectionType();
ExecuteQuery({ "PUBLISH", "icinga:config:update", type->GetName() + ":" + object->GetName() });
}
@ -215,7 +218,7 @@ void RedisWriter::SendConfigDelete(const ConfigObject::Ptr& object)
if (!m_Context)
return;
String typeName = object->GetReflectionType()->GetName();
String typeName = object->GetReflectionType()->GetName().ToLower();
String objectName = object->GetName();
ExecuteQueries({