Always update object authority, even w/o API feature

Regression from #7062

Thanks @nilmerg :)
This commit is contained in:
Michael Friedrich 2019-04-03 13:48:24 +02:00
parent e909302fd9
commit 5c3a9b77d7
1 changed files with 8 additions and 7 deletions

View File

@ -10,13 +10,14 @@ using namespace icinga;
void ApiListener::UpdateObjectAuthority()
{
ApiListener::Ptr instance = ApiListener::GetInstance();
if (!instance)
return;
Log(LogNotice, "ApiListener")
<< "Updating object authority for objects at endpoint '" << instance->GetIdentity() << "'.";
/* Always run this, even if there is no 'api' feature enabled. */
if (auto listener = ApiListener::GetInstance()) {
Log(LogNotice, "ApiListener")
<< "Updating object authority for objects at endpoint '" << listener->GetIdentity() << "'.";
} else {
Log(LogNotice, "ApiListener")
<< "Updating object authority for local objects.";
}
Zone::Ptr my_zone = Zone::GetLocalZone();