RedisWriter: Use IcingaApplication environment

This commit is contained in:
Noah Hilverling 2019-05-14 17:16:39 +02:00 committed by Michael Friedrich
parent c5b0884e44
commit a6ec60a992
1 changed files with 1 additions and 3 deletions

View File

@ -77,11 +77,9 @@ String RedisWriter::FormatCommandLine(const Value& commandLine)
return result;
}
static Value l_DefaultEnv = "production";
String RedisWriter::GetEnvironment()
{
return ScriptGlobal::Get("Environment", &l_DefaultEnv);
return ConfigType::GetObjectsByType<IcingaApplication>()[0]->GetEnvironment();
}
String RedisWriter::GetObjectIdentifier(const ConfigObject::Ptr& object)