From: Gunnar Beutner Date: Thu, 12 Sep 2013 13:12:19 +0000 (+0200) Subject: Fix delegation bug. X-Git-Tag: v0.0.3~539 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b510545d4daaabf9f954e5cfc117f2b849f5b2d2;p=icinga2 Fix delegation bug. --- diff --git a/components/cluster/clustercomponent.cpp b/components/cluster/clustercomponent.cpp index 474f36fb6..97f8aeeae 100644 --- a/components/cluster/clustercomponent.cpp +++ b/components/cluster/clustercomponent.cpp @@ -467,6 +467,8 @@ void ClusterComponent::ClusterTimerHandler(void) message->Set("method", "cluster::HeartBeat"); message->Set("params", params); + Endpoint::GetByName(GetIdentity())->SetFeatures(features); + RelayMessage(Endpoint::Ptr(), message, false); { @@ -1128,10 +1130,6 @@ void ClusterComponent::CheckAuthorityHandler(const DynamicObject::Ptr& object, c Array::Ptr authorities = object->GetAuthorities(); std::vector endpoints; - if ((type == "checker" && SupportsChecks()) || - (type == "notification" && SupportsNotifications())) - endpoints.push_back(GetIdentity()); - BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects()) { bool match = false; @@ -1157,12 +1155,6 @@ void ClusterComponent::CheckAuthorityHandler(const DynamicObject::Ptr& object, c std::sort(endpoints.begin(), endpoints.end()); - std::ostringstream msgbuf; - BOOST_FOREACH(const String& name, endpoints) { - msgbuf << name << ", "; - } - Log(LogDebug, "cluster", "Responsible for " + object->GetName() + ": " + msgbuf.str()); - String key = object->GetType()->GetName() + "\t" + object->GetName(); unsigned long hash = Utility::SDBM(key); unsigned long index = hash % endpoints.size();