mirror of https://github.com/Icinga/icinga2.git
RedisWriter: dump also environment_checksum (per config object)
This commit is contained in:
parent
4eee9572ab
commit
724ce1f172
|
@ -155,6 +155,7 @@ void RedisWriter::SendConfigUpdate(const ConfigObject::Ptr& object, bool useTran
|
|||
|
||||
Dictionary::Ptr checkSums = new Dictionary();
|
||||
checkSums->Set("name_checksum", CalculateCheckSumString(object->GetShortName()));
|
||||
checkSums->Set("environment_checksum", CalculateCheckSumString(GetEnvironment()));
|
||||
|
||||
// TODO: move this elsewhere
|
||||
Checkable::Ptr checkable = dynamic_pointer_cast<Checkable>(object);
|
||||
|
|
|
@ -41,9 +41,14 @@ String RedisWriter::FormatCheckSumBinary(const String& str)
|
|||
|
||||
static Value l_DefaultEnv = "production";
|
||||
|
||||
String RedisWriter::GetEnvironment()
|
||||
{
|
||||
return ScriptGlobal::Get("Environment", &l_DefaultEnv);
|
||||
}
|
||||
|
||||
String RedisWriter::GetIdentifier(const ConfigObject::Ptr& object)
|
||||
{
|
||||
return HashValue((Array::Ptr)new Array({ScriptGlobal::Get("Environment", &l_DefaultEnv), object->GetName()}));
|
||||
return HashValue((Array::Ptr)new Array({GetEnvironment(), object->GetName()}));
|
||||
}
|
||||
|
||||
String RedisWriter::CalculateCheckSumString(const String& str)
|
||||
|
|
|
@ -78,6 +78,7 @@ private:
|
|||
static String FormatCheckSumBinary(const String& str);
|
||||
|
||||
static String GetIdentifier(const ConfigObject::Ptr& object);
|
||||
static String GetEnvironment();
|
||||
static String CalculateCheckSumString(const String& str);
|
||||
static String CalculateCheckSumGroups(const Array::Ptr& groups);
|
||||
static String CalculateCheckSumProperties(const ConfigObject::Ptr& object, const std::set<String>& propertiesBlacklist);
|
||||
|
|
Loading…
Reference in New Issue