From b7406280420f2700b0cda7fc4752a1e33e50732f Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 12 Oct 2012 15:45:33 +0200 Subject: [PATCH] Bugfix: Delegation didn't work for local-only instances. --- components/delegation/delegationcomponent.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/components/delegation/delegationcomponent.cpp b/components/delegation/delegationcomponent.cpp index a345ae038..9e8e85a03 100644 --- a/components/delegation/delegationcomponent.cpp +++ b/components/delegation/delegationcomponent.cpp @@ -44,13 +44,14 @@ vector DelegationComponent::GetCheckerCandidates(const Service::P BOOST_FOREACH(tie(tuples::ignore, object), DynamicObject::GetObjects("Endpoint")) { Endpoint::Ptr endpoint = dynamic_pointer_cast(object); - /* ignore local-only endpoints */ - if (endpoint->IsLocal()) + String myIdentity = EndpointManager::GetInstance()->GetIdentity(); + + /* ignore local-only endpoints (unless this is a local-only instance) */ + if (endpoint->IsLocal() && !myIdentity.IsEmpty()) continue; /* ignore disconnected endpoints */ - if (!endpoint->IsConnected() && - endpoint->GetName() != EndpointManager::GetInstance()->GetIdentity()) + if (!endpoint->IsConnected() && endpoint->GetName() != myIdentity) continue; /* ignore endpoints that aren't running the checker component */ @@ -75,9 +76,6 @@ void DelegationComponent::DelegationTimerHandler(void) BOOST_FOREACH(tie(tuples::ignore, object), DynamicObject::GetObjects("Endpoint")) { Endpoint::Ptr endpoint = dynamic_pointer_cast(object); - if (endpoint->IsLocal()) - continue; - histogram[endpoint] = 0; } -- 2.40.0