]> granicus.if.org Git - icinga2/commitdiff
Fix delegation bug.
authorGunnar Beutner <gunnar.beutner@netways.de>
Thu, 12 Sep 2013 13:12:19 +0000 (15:12 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Thu, 12 Sep 2013 13:12:19 +0000 (15:12 +0200)
components/cluster/clustercomponent.cpp

index 474f36fb668dd182e4ace8ed32b72754f268d658..97f8aeeaedf3547cce86d636273edd547d7a06bf 100644 (file)
@@ -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<String> endpoints;
 
-       if ((type == "checker" && SupportsChecks()) ||
-           (type == "notification" && SupportsNotifications()))
-               endpoints.push_back(GetIdentity());
-
        BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects<Endpoint>()) {
                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();