From: Michael Friedrich Date: Wed, 3 Apr 2019 11:48:24 +0000 (+0200) Subject: Always update object authority, even w/o API feature X-Git-Tag: v2.11.0-rc1~167^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c3a9b77d7337bf1996363510878b55ed62833e2;p=icinga2 Always update object authority, even w/o API feature Regression from #7062 Thanks @nilmerg :) --- diff --git a/lib/remote/apilistener-authority.cpp b/lib/remote/apilistener-authority.cpp index 23f571119..f3740dec5 100644 --- a/lib/remote/apilistener-authority.cpp +++ b/lib/remote/apilistener-authority.cpp @@ -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();