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

index bed6ca409b9da134b02c6bc0235ae34bea1321d7..671578e3f2a24a8dbd70321eb55083ebac4fd58f 100644 (file)
@@ -1133,7 +1133,7 @@ void ClusterComponent::CheckAuthorityHandler(const DynamicObject::Ptr& object, c
        BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjects<Endpoint>()) {
                bool match = false;
 
-               if (!endpoint->IsConnected() || !endpoint->HasFeature(type))
+               if ((!endpoint->IsConnected() && endpoint->GetName() != GetIdentity()) || !endpoint->HasFeature(type))
                        continue;
 
                if (authorities) {
@@ -1153,8 +1153,11 @@ void ClusterComponent::CheckAuthorityHandler(const DynamicObject::Ptr& object, c
                        endpoints.push_back(endpoint->GetName());
        }
 
-       if (endpoints.empty())
+       if (endpoints.empty()) {
+               result = false;
+
                return;
+       }
 
        std::sort(endpoints.begin(), endpoints.end());